|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-05-25 05:11 UTC] alan at akbkhome dot com
[2006-05-25 11:06 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 07:00:02 2025 UTC |
Description: ------------ <var> with out attributes causes segfault due to no checking on att patch to fix: ? run-tests.php cvs diff: Diffing . Index: wddx.c =================================================================== RCS file: /repository/php-src/ext/wddx/wddx.c,v retrieving revision 1.119.2.10 diff -u -r1.119.2.10 wddx.c --- wddx.c 23 Apr 2006 16:02:05 -0000 1.119.2.10 +++ wddx.c 25 May 2006 05:00:10 -0000 @@ -811,14 +811,15 @@ wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); } else if (!strcmp(name, EL_VAR)) { int i; - - for (i = 0; atts[i]; i++) { - if (!strcmp(atts[i], EL_NAME) && atts[++i] && atts[i][0]) { - char *decoded; - int decoded_len; - decoded = xml_utf8_decode(atts[i], strlen(atts[i]), &decoded_len, "ISO-8859-1"); - stack->varname = decoded; - break; + if (atts) { + for (i = 0; atts[i]; i++) { + if (!strcmp(atts[i], EL_NAME) && atts[++i] && atts[i][0]) { + char *decoded; + int decoded_len; + decoded = xml_utf8_decode(atts[i], strlen(atts[i]), &decoded_len, "ISO-8859-1"); + stack->varname = decoded; + break; + } } } } else if (!strcmp(name, EL_RECORDSET)) { Reproduce code: --------------- php -r 'var_dump(wddx_deserialize(file_get_contents("http://www.akbkhome.com/svn/hebehaven2/templates/backend/members_edit.html.rules.wddx"))); Expected result: ---------------- a nice printout Actual result: -------------- segfault backtrace basically says att = 0x0