]> git.ipfire.org Git - thirdparty/qemu.git/commit
json-parser: fix handling of large whole number values
authorMichael Roth <mdroth@linux.vnet.ibm.com>
Fri, 10 May 2013 22:46:05 +0000 (17:46 -0500)
committerLuiz Capitulino <lcapitulino@redhat.com>
Thu, 23 May 2013 13:44:20 +0000 (09:44 -0400)
commit3d5b3ec6d460a92245215aaf7b349b0b9e5ffa25
tree486e04aadbe46c7d142a2a33dde2b1644e62c607
parent0b400e792718f59275d5d54c21de9a589b35a81f
json-parser: fix handling of large whole number values

Currently our JSON parser assumes that numbers lacking a fractional
value are integers and attempts to store them as QInt/int64 values. This
breaks in the case where the number overflows/underflows int64 values (which
is still valid JSON)

Fix this by detecting such cases and using a QFloat to store the value
instead.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qobject/json-parser.c