]> granicus.if.org Git - php/commitdiff
Align overflow error messages with upstream
authorChristoph M. Becker <cmbecker69@gmx.de>
Fri, 9 Feb 2018 23:25:29 +0000 (00:25 +0100)
committerChristoph M. Becker <cmbecker69@gmx.de>
Sat, 10 Feb 2018 14:41:33 +0000 (15:41 +0100)
This particularly fixes two tests (bug66356.phpt and bug72339.phpt) if
PHP has been build with an external libgd.

ext/gd/gd_compat.c
ext/gd/libgd/gd_security.c
ext/gd/tests/bug66356.phpt
ext/gd/tests/bug72339.phpt
ext/gd/tests/createfromwbmp2.phpt
ext/gd/tests/imageloadfont_invalid.phpt
ext/gd/tests/libgd00101.phpt

index aa1d51700d2d8dfd4ebc4273ef0c30cf8ecfe912..2ea1bc4d0c8c1d19aac05da192d0f23e8d664bc6 100644 (file)
@@ -49,11 +49,11 @@ int overflow2(int a, int b)
 {
 
        if(a <= 0 || b <= 0) {
-               php_error_docref(NULL, E_WARNING, "gd warning: one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully\n");
+               php_error_docref(NULL, E_WARNING, "one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully\n");
                return 1;
        }
        if(a > INT_MAX / b) {
-               php_error_docref(NULL, E_WARNING, "gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully\n");
+               php_error_docref(NULL, E_WARNING, "product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully\n");
                return 1;
        }
        return 0;
index 3813707ade2ba9170ccb24050b2f713288874a3a..2a7d4a032ac2bf33b0bcfeff82c33e65992fc8a4 100644 (file)
 int overflow2(int a, int b)
 {
        if(a <= 0 || b <= 0) {
-               gd_error("gd warning: one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully\n");
+               gd_error("one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully\n");
                return 1;
        }
        if(a > INT_MAX / b) {
-               gd_error("gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully\n");
+               gd_error("product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully\n");
                return 1;
        }
        return 0;
index 583d74942c8cc21123f33f29d5048ccb5b483230..fc4a60439f89be072a845fa8aade3616bf8cc1d5 100644 (file)
@@ -38,12 +38,12 @@ Array
     [height] => 10
 )
 
-Warning: imagecrop(): gd warning: one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully
+Warning: imagecrop(): one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully
  in %sbug66356.php on line %d
 bool(false)
 resource(%d) of type (gd)
 resource(%d) of type (gd)
 
-Warning: imagecrop(): gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
+Warning: imagecrop(): product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
  in %sbug66356.php on line %d
 bool(false)
\ No newline at end of file
index c8862833464ad76d972be44bc5e08853072f1cff..20daea8106c35c070cdaa9b5d1136a64b86a9d66 100644 (file)
@@ -32,7 +32,7 @@ unlink($fname);
 
 ?>
 --EXPECTF--    
-Warning: imagecreatefromgd2(): gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
+Warning: imagecreatefromgd2(): product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
  in %sbug72339.php on line %d
 
 Warning: imagecreatefromgd2(): '%sbug72339.gd' is not a valid GD2 file in %sbug72339.php on line %d
index 9e7ef12dac0a97adcbb5f23e7952934867a4cde3..bbb475c423b95d63ccd0366090a4aba1e8c8b2fa 100644 (file)
@@ -42,7 +42,7 @@ $im = imagecreatefromwbmp($filename);
 unlink($filename);
 ?>
 --EXPECTF--
-Warning: imagecreatefromwbmp(): gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
+Warning: imagecreatefromwbmp(): product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
  in %s on line %d
 
 Warning: imagecreatefromwbmp(): '%s' is not a valid WBMP file in %s on line %d
index 6cf0e336b69eea795c679129558d8af06ec0334d..871d1510f0151552b637958d5a027e36ffc7f7db 100644 (file)
@@ -19,7 +19,7 @@ imagestring($image, $font, 0, 0, "Hello", $black);
 unlink($filename);
 ?>
 --EXPECTF--
-Warning: imageloadfont(): gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
+Warning: imageloadfont(): product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
  in %simageloadfont_invalid.php on line %d
 
 Warning: imageloadfont(): Error reading font, invalid font header in %simageloadfont_invalid.php on line %d
index 1c6623d2e0d8b8cf4568eb38cadcb4315bd31cc1..4154012fbda1bf69efea868244fef4342d2fef2d 100644 (file)
@@ -11,7 +11,7 @@ $im = imagecreatefromgd(dirname(__FILE__) . '/libgd00101.gd');
 var_dump($im);
 ?>
 --EXPECTF--
-Warning: imagecreatefromgd(): gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
+Warning: imagecreatefromgd(): product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
  in %slibgd00101.php on line %d
 
 Warning: imagecreatefromgd(): '%slibgd00101.gd' is not a valid GD file in %slibgd00101.php on line %d