--- embedaddon/php/ext/exif/exif.c 2012/05/29 12:34:37 1.1.1.2 +++ embedaddon/php/ext/exif/exif.c 2013/07/22 01:31:40 1.1.1.3 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2012 The PHP Group | + | Copyright (c) 1997-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: exif.c,v 1.1.1.2 2012/05/29 12:34:37 misho Exp $ */ +/* $Id: exif.c,v 1.1.1.3 2013/07/22 01:31:40 misho Exp $ */ /* ToDos * @@ -138,7 +138,7 @@ const zend_function_entry exif_functions[] = { }; /* }}} */ -#define EXIF_VERSION "1.4 $Id: exif.c,v 1.1.1.2 2012/05/29 12:34:37 misho Exp $" +#define EXIF_VERSION "1.4 $Id: exif.c,v 1.1.1.3 2013/07/22 01:31:40 misho Exp $" /* {{{ PHP_MINFO_FUNCTION */ @@ -3254,7 +3254,7 @@ static void exif_process_APP12(image_info_type *ImageI if ((l1 = php_strnlen(buffer+2, length-2)) > 0) { exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2 TSRMLS_CC); if (length > 2+l1+1) { - l2 = php_strnlen(buffer+2+l1+1, length-2-l1+1); + l2 = php_strnlen(buffer+2+l1+1, length-2-l1-1); exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1 TSRMLS_CC); } } @@ -3404,6 +3404,10 @@ static int exif_scan_JPEG_header(image_info_type *Imag case M_SOF13: case M_SOF14: case M_SOF15: + if ((itemlen - 2) < 6) { + return FALSE; + } + exif_process_SOFn(Data, marker, &sof_info); ImageInfo->Width = sof_info.width; ImageInfo->Height = sof_info.height;