summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2009-09-19 21:21:37 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2009-09-19 21:21:37 +0000
commit3d13f6abd059926426becd30c53547956b2bd3b2 (patch)
tree15e9575d16ba322feadc8f5b531a2a613b494c14 /usr.bin
parente8be2c58e91023fe36720327dd981408b81e4786 (diff)
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
Diffstat (limited to 'usr.bin')
-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) {