[thrift] php thrift_protocol crash fixes
authordweatherford <dev-null@apache.org>
Sat, 8 Mar 2008 05:51:24 +0000 (05:51 +0000)
committerdweatherford <dev-null@apache.org>
Sat, 8 Mar 2008 05:51:24 +0000 (05:51 +0000)
commit840ca085fcfe737554ede28088d4ae9adf457216
tree6a2f4f359b8d5bb32a9e3a2a15874156e7acea34
parent0e913a6381c5dc6b50460d18e2490165db4de629
[thrift] php thrift_protocol crash fixes

Summary: The convert_to_*_ex functions were being used improperly resulting
  in heap corruption in some cases; I just switched everything over to the
  non-ex versions since it shouldn't matter if I modify the value being
  serialized in place to coerce it to the proper type.

  Also fixed a potential crash for map, set, and list types when not passed
  an array, by first attempting an array conversion and then throwing a
  tprotocolexception if that doesn't succeed. (Actually, PHP might fatal there
  instead, it wasn't immediately clear from reading the code if that would
  be the case).

Reviewed by: marcel
Test plan: Ran under php-5.2.5, debug and release builds. No more heap corruption
  or memory leak complaints (the latter also a side effect of undesired zval
  reference separation).
Revert: only if you love SIGSEGV

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665566 13f79535-47bb-0310-9956-ffa450edef68
lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp