Merge branch 'PHP-5.3' into PHP-5.4

* PHP-5.3:
  - Added missing bound check in iptcparse() (path by chris at chiappa.net)
This commit is contained in:
Felipe Pena 2012-04-29 19:14:03 -03:00
commit 6008f9af8f

View File

@ -336,13 +336,13 @@ PHP_FUNCTION(iptcparse)
len = (((unsigned short) buffer[ inx ])<<8) | (unsigned short)buffer[ inx+1 ];
inx += 2;
}
snprintf(key, sizeof(key), "%d#%03d", (unsigned int) dataset, (unsigned int) recnum);
if ((len > str_len) || (inx + len) > str_len) {
if ((len < 0) || (len > str_len) || (inx + len) > str_len) {
break;
}
snprintf(key, sizeof(key), "%d#%03d", (unsigned int) dataset, (unsigned int) recnum);
if (tagsfound == 0) { /* found the 1st tag - initialize the return array */
array_init(return_value);
}