summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjakemsr <jakemsr@openbsd.org>2009-09-19 21:21:36 +0000
committerjakemsr <jakemsr@openbsd.org>2009-09-19 21:21:36 +0000
commit43543dfe6b2d4a6d40279a48f17ad64380747140 (patch)
treef1d4c5241dc3c904599b2b7baab793ce532a877f
parentIf UDLIO_DAMAGE fails to queue the damage drawing request, undo the (diff)
downloadwireguard-openbsd-43543dfe6b2d4a6d40279a48f17ad64380747140.tar.xz
wireguard-openbsd-43543dfe6b2d4a6d40279a48f17ad64380747140.zip
if pipe_read() returns 0 we are at EOF and the structure describing
the pipe will be free()d, so don't try to access the structure. ok ratchov
-rw-r--r--usr.bin/aucat/wav.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.bin/aucat/wav.c b/usr.bin/aucat/wav.c
index e11e01ff3c5..0b7bfba6f8c 100644
--- a/usr.bin/aucat/wav.c
+++ b/usr.bin/aucat/wav.c
@@ -192,6 +192,8 @@ wav_read(struct file *file, unsigned char *data, unsigned count)
}
}
n = pipe_read(file, data, count);
+ if (n == 0)
+ return 0;
if (f->rbytes >= 0)
f->rbytes -= n;
if (f->map) {