cvs: ZendEngine2(PHP_5_3) / zend_execute.c /tests bug39018.phpt bug39018_2.phpt
[email protected] ("Felipe Pena")
| Newsgroups | php.zend-engine.cvs |
|---|---|
| Message-ID | <cvsfelipe1204976112@cvsserver> |
felipe Sat Mar 8 11:35:12 2008 UTC
Added files: (Branch: PHP_5_3)
/ZendEngine2/tests bug39018.phpt bug39018_2.phpt
Modified files:
/ZendEngine2 zend_execute.c
Log:
Fixed bug #39018 (Error control operator '@' fails to suppress "Uninitialized string offset")
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute.c?r1=1.716.2.12.2.24.2.21&r2=1.716.2.12.2.24.2.22&diff_format=u
Index: ZendEngine2/zend_execute.c
diff -u ZendEngine2/zend_execute.c:1.716.2.12.2.24.2.21 ZendEngine2/zend_execute.c:1.716.2.12.2.24.2.22
--- ZendEngine2/zend_execute.c:1.716.2.12.2.24.2.21 Tue Mar 4 10:06:51 2008
+++ ZendEngine2/zend_execute.c Sat Mar 8 11:35:12 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute.c,v 1.716.2.12.2.24.2.21 2008/03/04 10:06:51 dmitry Exp $ */
+/* $Id: zend_execute.c,v 1.716.2.12.2.24.2.22 2008/03/08 11:35:12 felipe Exp $ */
#define ZEND_INTENSIVE_DEBUGGING 0
@@ -200,7 +200,6 @@
if (T->str_offset.str->type != IS_STRING
|| ((int)T->str_offset.offset < 0)
|| (T->str_offset.str->value.str.len <= (int)T->str_offset.offset)) {
- zend_error(E_NOTICE, "Uninitialized string offset: %d", T->str_offset.offset);
ptr->value.str.val = STR_EMPTY_ALLOC();
ptr->value.str.len = 0;
} else {
@@ -1188,6 +1187,9 @@
dim = &tmp;
}
if (result) {
+ if (Z_LVAL_P(dim) < 0 || Z_STRLEN_P(container) <= Z_LVAL_P(dim)) {
+ zend_error(E_NOTICE, "Uninitialized string offset: %ld", Z_LVAL_P(dim));
+ }
result->str_offset.str = container;
PZVAL_LOCK(container);
result->str_offset.offset = Z_LVAL_P(dim);
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug39018.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/bug39018.phpt
+++ ZendEngine2/tests/bug39018.phpt
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug39018_2.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/bug39018_2.phpt
+++ ZendEngine2/tests/bug39018_2.phpt