You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix SimpleXML integer offsets that cannot resolve aliasing a node
sxe_get_element_by_offset scanned with nodendx <= offset, so a negative
offset skipped the loop and returned the node it started from, and the
SXE_ITER_NONE branches of the read and write handlers aliased the node
for every offset other than 0. Reads and isset() reported an existing
element and writes overwrote it. An offset that resolves to no element
now warns and leaves the document alone.
ClosesGH-23068
if (member&&(Z_LVAL_P(member) <0||cnt<Z_LVAL_P(member))) {
323
325
php_error_docref(NULL, E_WARNING, "Cannot add element %s number "ZEND_LONG_FMT" when only "ZEND_LONG_FMT" such elements exist", mynode->name, Z_LVAL_P(member), cnt);
if (member&&(Z_LVAL_P(member) <0||cnt<Z_LVAL_P(member))) {
590
593
php_error_docref(NULL, E_WARNING, "Cannot add element %s number "ZEND_LONG_FMT" when only "ZEND_LONG_FMT" such elements exist", mynode->name, Z_LVAL_P(member), cnt);
0 commit comments