From 29823f285598a9170b1d2a706e6b83d4751acaba Mon Sep 17 00:00:00 2001 From: markster Date: Thu, 15 Apr 2004 16:02:42 +0000 Subject: Do proper bounds checking in formats (bug #1356) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2694 f38db490-d61c-443f-a65b-d21fe96a405b --- formats/format_wav.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'formats/format_wav.c') diff --git a/formats/format_wav.c b/formats/format_wav.c index dbca8ed50..52f1508ab 100755 --- a/formats/format_wav.c +++ b/formats/format_wav.c @@ -525,8 +525,9 @@ static int wav_seek(struct ast_filestream *fs, long sample_offset, int whence) offset = max - samples; if (whence != SEEK_FORCECUR) { offset = (offset > max)?max:offset; - offset = (offset < min)?min:offset; } + // always protect the header space. + offset = (offset < min)?min:offset; return lseek(fs->fd,offset,SEEK_SET); } -- cgit v1.2.3