Browse Source

Fix bug #67250 (iptcparse out-of-bounds read)

pull/684/head
Stanislav Malyshev 12 years ago
parent
commit
3e9cb6a4a5
  1. 1
      NEWS
  2. 3
      ext/standard/iptc.c
  3. 8
      ext/standard/tests/image/bug67250.phpt

1
NEWS

@ -12,6 +12,7 @@ PHP NEWS
. Fixed bug #67245 (usage of memcpy() with overlapping src and dst in
zend_exceptions.c). (Bob)
. Fixed bug #67247 (spl_fixedarray_resize integer overflow). (Stas)
. Fixed bug #67250 (iptcparse out-of-bounds read). (Stas)
- Date:
. Fixed bug #67118 (DateTime constructor crash with invalid data). (Anatol)

3
ext/standard/iptc.c

@ -329,6 +329,9 @@ PHP_FUNCTION(iptcparse)
recnum = buffer[ inx++ ];
if (buffer[ inx ] & (unsigned char) 0x80) { /* long tag */
if((inx+6) >= str_len) {
break;
}
len = (((long) buffer[ inx + 2 ]) << 24) + (((long) buffer[ inx + 3 ]) << 16) +
(((long) buffer[ inx + 4 ]) << 8) + (((long) buffer[ inx + 5 ]));
inx += 6;

8
ext/standard/tests/image/bug67250.phpt

@ -0,0 +1,8 @@
--TEST--
Bug #67250 (iptcparse out-of-bounds read)
--FILE--
<?php
var_dump(iptcparse("\x1C\x02_\x80___"));
?>
--EXPECT--
bool(false)
Loading…
Cancel
Save