From 48d13f84a5727f6578565d1872987c36ec647e68 Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Fri, 7 Apr 2006 22:07:38 +0000 Subject: [PATCH] Bug 6913 - fix for possible buffer overflow git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@18436 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- formats/format_jpeg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/formats/format_jpeg.c b/formats/format_jpeg.c index d71aeec801..96fed0deab 100644 --- a/formats/format_jpeg.c +++ b/formats/format_jpeg.c @@ -55,7 +55,7 @@ static struct ast_frame *jpeg_read_image(int fd, int len) struct ast_frame fr; int res; char buf[65536]; - if (len > sizeof(buf)) { + if (len > sizeof(buf) || len < 0) { ast_log(LOG_WARNING, "JPEG image too large to read\n"); return NULL; } -- 2.47.2