From: Sara Golemon Date: Fri, 29 Apr 2016 21:05:06 +0000 (+0000) Subject: Raise compiler warning on octal overflow X-Git-Tag: php-7.1.0alpha1~141 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=95af467d8def3f3453670340f4e65ce7c189d4f6;p=php Raise compiler warning on octal overflow Addresses https://bugs.php.net/bug.php?id=71994 --- diff --git a/NEWS b/NEWS index 78b1e53fbd..cfacdb3524 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,7 @@ PHP NEWS respect scientific notation in numeric strings. (Andrea) . Implemented the RFC `Catching multiple exception types`. (Bronislaw Bialek, Pierrick) + . Raise a compile-time warning on octal escape sequence overflow. (Sara) - FTP: . Implemented FR #55651 (Option to ignore the returned FTP PASV address). diff --git a/Zend/tests/oct_overflow_char.phpt b/Zend/tests/oct_overflow_char.phpt new file mode 100644 index 0000000000..14a9bb4aeb --- /dev/null +++ b/Zend/tests/oct_overflow_char.phpt @@ -0,0 +1,10 @@ +--TEST-- +Octal overflow in string interpolation +--FILE-- + '3')) { + /* 3 octit values must not overflow 0xFF (\377) */ + zend_error(E_COMPILE_WARNING, "Octal escape sequence overflow \\%s is greater than \\377", octal_buf); + } + *t++ = (char) ZEND_STRTOL(octal_buf, NULL, 8); } else { *t++ = '\\';