]> git.evergreen-ils.org Git - OpenSRF.git/commit
Extended the JSON_INIT_CLEAR macro to avoid segfaults.
authorscottmk <scottmk@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 5 Aug 2009 22:27:04 +0000 (22:27 +0000)
committerscottmk <scottmk@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 5 Aug 2009 22:27:04 +0000 (22:27 +0000)
commita9cfb5f477ac1098875039347b13d3a4bc365bb6
tree89e2eab461756337883c6b71ac325dc077ebf2cb
parentbf2398c1486ec9fd284293df00f72e743e77996e
Extended the JSON_INIT_CLEAR macro to avoid segfaults.

Scenario: converting a JSON_BOOL, with a value of true, to a JSON_HASH or
JSON_ARRAY.  The true value (in a union with an osrfHash* and an osrfList*)
was being interpreted as a non_NULL pointer and deferenced.  Oops.

With this change, we clear the boolean value (by nullifying one of the
unioned pointers) whenever changing from a JSON_BOOL to anything else.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1733 9efc2488-bf62-4759-914b-345cdb29e865
src/libopensrf/osrf_json_object.c