summaryrefslogtreecommitdiffstats
path: root/include/sysemu
diff options
context:
space:
mode:
authorAni Sinha2020-09-21 11:33:25 +0200
committerEduardo Habkost2020-12-10 23:32:26 +0100
commit1bf8b88f144bee747e386c88d45d772e066bbb36 (patch)
tree060d35f9e5e4eca60072e0a5c2931c43fd648b8e /include/sysemu
parentMerge remote-tracking branch 'remotes/armbru/tags/pull-misc-2020-12-10' into ... (diff)
downloadqemu-1bf8b88f144bee747e386c88d45d772e066bbb36.tar.gz
qemu-1bf8b88f144bee747e386c88d45d772e066bbb36.tar.xz
qemu-1bf8b88f144bee747e386c88d45d772e066bbb36.zip
qom: code hardening - have bound checking while looping with integer value
Object property insertion code iterates over an integer to get an unused index that can be used as an unique name for an object property. This loop increments the integer value indefinitely. Although very unlikely, this can still cause an integer overflow. In this change, we fix the above code by checking against INT16_MAX and making sure that the interger index does not overflow beyond that value. If no available index is found, the code would cause an assertion failure. This assertion failure is necessary because the callers of the function do not check the return value for NULL. Signed-off-by: Ani Sinha <ani@anisinha.ca> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20200921093325.25617-1-ani@anisinha.ca> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'include/sysemu')
0 files changed, 0 insertions, 0 deletions