tony2001 Thu May 10 12:21:42 2007 UTC
Added files:
/php-src/ext/standard/tests/image iptcembed_001.phpt
Modified files:
/php-src/ext/standard iptc.c
Log:
fix segfault in iptcembed()
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/iptc.c?r1=1.60&r2=1.61&diff_format=u
Index: php-src/ext/standard/iptc.c
diff -u php-src/ext/standard/iptc.c:1.60 php-src/ext/standard/iptc.c:1.61
--- php-src/ext/standard/iptc.c:1.60 Mon Feb 12 20:27:48 2007
+++ php-src/ext/standard/iptc.c Thu May 10 12:21:42 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: iptc.c,v 1.60 2007/02/12 20:27:48 tony2001 Exp $ */
+/* $Id: iptc.c,v 1.61 2007/05/10 12:21:42 tony2001 Exp $ */
/*
* Functions to parse & compse IPTC data.
@@ -211,16 +211,16 @@
if (php_iptc_get1(fp, spool, poi?&poi:0 TSRMLS_CC) != 0xFF) {
fclose(fp);
- if (poi) {
- efree(poi);
+ if (spoolbuf) {
+ efree(spoolbuf);
}
RETURN_FALSE;
}
if (php_iptc_get1(fp, spool, poi?&poi:0 TSRMLS_CC) != 0xD8) {
fclose(fp);
- if (poi) {
- efree(poi);
+ if (spoolbuf) {
+ efree(spoolbuf);
}
RETURN_FALSE;
}
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/image/iptcembed_001.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/image/iptcembed_001.phpt
+++ php-src/ext/standard/tests/image/iptcembed_001.phpt
--TEST--
iptcembed() and wrong file
--FILE--
<?php
$file = dirname(__FILE__).'/iptcembed_001.data';
$fp = fopen($file, "w");
fwrite($fp, b"-1-1");
fclose($fp);
var_dump(iptcembed(-1, $file, -1));
echo "Done\n";
?>
--EXPECTF--
bool(false)
Done
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php