]> git.proxmox.com Git - mirror_qemu.git/commit - tests/libqtest.h
qtest: Avoid passing raw strings through hmp()
authorEric Blake <eblake@redhat.com>
Mon, 11 Sep 2017 17:20:14 +0000 (12:20 -0500)
committerThomas Huth <thuth@redhat.com>
Fri, 15 Sep 2017 07:05:19 +0000 (09:05 +0200)
commit7b899f4dd596dbb7d271f7fab36fbfffec84868e
tree2cc98be4af927083e26c8d40b25d93694eb8cf07
parent4fb609adc91c9352ae72b82cef53002c2e32d7fb
qtest: Avoid passing raw strings through hmp()

hmp() passes its string argument through the sprintf() family;
with a proper attribute, gcc -Wformat warns us when we do something
dangerous like passing a non-constant format string.  Fortunately,
all our strings were safe, but checking whether the string can
contain an unintended % is easy to avoid and therefore worth doing.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/libqtest.h
tests/test-hmp.c