diff options
author | Eric Blake <eblake@redhat.com> | 2016-11-23 11:36:54 -0600 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2016-12-05 17:09:34 +0100 |
commit | 043b5a49516f5037430e7864e23fc2fdd39f2b10 (patch) | |
tree | 3d490ce21b9f9f9a63f3453c7e982df44bdb0a4b /tcg-runtime.c | |
parent | bd8ef5060dd2124a54578241da9a572faf7658dd (diff) |
qmp-event: Avoid qobject_from_jsonf("%"PRId64)
The qobject_from_jsonf() function implements a pseudo-printf
language for creating a QObject; however, it is hard-coded to
only parse a subset of formats understood by -Wformat, and is
not a straight synonym to bare printf(). In particular, any
use of an int64_t integer works only if the system's
definition of PRId64 matches what the parser expects; which
works on glibc (%lld or %ld depending on 32- vs. 64-bit) and
mingw (%I64d), but not on Mac OS (%qd). Rather than enhance
the parser, it is just as easy to use 'long long', which we
know always works. There are few enough callers of
qobject_from_json[fv]() that it is easy to audit that this is
the only non-testsuite caller that was actually relying on
this particular conversion.
Reported by: G 3 <programmingkidx@gmail.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1479922617-4400-2-git-send-email-eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Cast tv.tv_sec, tv.tv_usec to long long for type correctness]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'tcg-runtime.c')
0 files changed, 0 insertions, 0 deletions