mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
1bf8b88f14
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> |
||
---|---|---|
.. | ||
container.c | ||
meson.build | ||
object.c | ||
object_interfaces.c | ||
qom-hmp-cmds.c | ||
qom-qmp-cmds.c | ||
qom-qobject.c | ||
trace-events | ||
trace.h |