Browse Source

- Fixed bug #52468 (wddx_deserialize corrupts integer field value when left empty)

pull/12/head
Felipe Pena 16 years ago
parent
commit
6150174941
  1. 2
      NEWS
  2. 20
      ext/wddx/tests/bug52468.phpt
  3. 1
      ext/wddx/wddx.c

2
NEWS

@ -6,6 +6,8 @@ PHP NEWS
- Fixed bug #52487 (PDO::FETCH_INTO leaks memory). (Felipe)
- Fixed bug #52484 (__set() ignores setting properties with empty names).
(Felipe)
- Fixed bug #52468 (wddx_deserialize corrupts integer field value when left
empty). (Felipe)
- Fixed bug #52436 (Compile error if systems do not have stdint.h)
(Sriram Natarajan)

20
ext/wddx/tests/bug52468.phpt

@ -0,0 +1,20 @@
--TEST--
Bug #52468 (wddx_deserialize corrupts integer field value when left empty)
--FILE--
<?php
$message = "<wddxPacket version='1.0'><header><comment>my_command</comment></header><data><struct><var name='handle'><number></number></var></struct></data></wddxPacket>";
print_r(wddx_deserialize($message));
print_r(wddx_deserialize($message));
?>
--EXPECT--
Array
(
[handle] => 0
)
Array
(
[handle] => 0
)

1
ext/wddx/wddx.c

@ -785,6 +785,7 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
ALLOC_ZVAL(ent.data);
INIT_PZVAL(ent.data);
Z_TYPE_P(ent.data) = IS_LONG;
Z_LVAL_P(ent.data) = 0;
wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
} else if (!strcmp(name, EL_BOOLEAN)) {
int i;

Loading…
Cancel
Save