summaryrefslogtreecommitdiff
path: root/ext/gmp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2018-07-02 17:28:45 +0200
committerNikita Popov <nikita.ppv@gmail.com>2018-07-02 17:29:32 +0200
commit09bb2527e96bcefa79ae5d5d93038f2a0cc80d0a (patch)
treec19721a3c63f378a4bc66113a41188bf992ed03c /ext/gmp
parent26a33a96fa5a85bcc74e33c1b8103d3841e11bad (diff)
parentc793885b7624be4e2a95c69a2b8b3fee969b312f (diff)
downloadphp-git-09bb2527e96bcefa79ae5d5d93038f2a0cc80d0a.tar.gz
Merge branch 'PHP-7.1' into PHP-7.2
Diffstat (limited to 'ext/gmp')
-rw-r--r--ext/gmp/bug74670.phpt10
-rw-r--r--ext/gmp/tests/serialize.phpt2
2 files changed, 11 insertions, 1 deletions
diff --git a/ext/gmp/bug74670.phpt b/ext/gmp/bug74670.phpt
new file mode 100644
index 0000000000..a28640b5c6
--- /dev/null
+++ b/ext/gmp/bug74670.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Bug #74670: Integer Underflow when unserializing GMP and possible other classes
+--FILE--
+<?php
+$str = 'C:3:"GMP":4:{s:6666666666:""}';
+var_dump(unserialize($str));
+?>
+--EXPECTF--
+Notice: unserialize(): Error at offset 13 of 29 bytes in %s on line %d
+bool(false)
diff --git a/ext/gmp/tests/serialize.phpt b/ext/gmp/tests/serialize.phpt
index 5e308fa14e..e9b9bb549f 100644
--- a/ext/gmp/tests/serialize.phpt
+++ b/ext/gmp/tests/serialize.phpt
@@ -18,7 +18,7 @@ try {
} catch (Exception $e) { var_dump($e->getMessage()); }
try {
- unserialize('C:3:"GMP":8:{s:2:"42";}');
+ unserialize('C:3:"GMP":9:{s:2:"42";}');
} catch (Exception $e) { var_dump($e->getMessage()); }
?>