-
-
Save anonymous/24005a39e936688b845a6a88ae334210 to your computer and use it in GitHub Desktop.
Patch for 72275
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit f64a911775186f14463155aa4d72c254f72a4a19 | |
Author: Stanislav Malyshev <stas@php.net> | |
Date: Mon Jun 13 23:12:47 2016 -0700 | |
Fix bug #72275: don't allow smart_str to overflow int | |
diff --git a/ext/standard/php_smart_str.h b/ext/standard/php_smart_str.h | |
index 1872fa8..9ba08fb 100644 | |
--- a/ext/standard/php_smart_str.h | |
+++ b/ext/standard/php_smart_str.h | |
@@ -63,6 +63,9 @@ | |
newlen = (d)->len + (n); \ | |
if (newlen >= (d)->a) { \ | |
(d)->a = newlen + SMART_STR_PREALLOC; \ | |
+ if (UNEXPECTED((d)->a > INT_MAX)) { \ | |
+ zend_error(E_ERROR, "String size overflow"); \ | |
+ } \ | |
SMART_STR_DO_REALLOC(d, what); \ | |
} \ | |
} \ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment