diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2020-12-11 12:16:33 +0000 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2020-12-11 12:16:33 +0000 |
| commit | 33744604d768e4281d425baa3ce7128b91319503 (patch) | |
| tree | 5e5a4aa377ac64d3701e9764db78d8c0b5057ed4 /qom/object.c | |
| parent | 2ecfc0657afa5d29a373271b342f704a1a3c6737 (diff) | |
| parent | d1615ea575b08fc96aeeb2630c40c5e51364b95c (diff) | |
| download | focaccia-qemu-33744604d768e4281d425baa3ce7128b91319503.tar.gz focaccia-qemu-33744604d768e4281d425baa3ce7128b91319503.zip | |
Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging
Machine queue, 2020-12-10 Some patches that were queued after 5.2 soft freeze. # gpg: Signature made Thu 10 Dec 2020 22:41:29 GMT # gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6 # gpg: issuer "ehabkost@redhat.com" # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full] # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/machine-next-pull-request: i386/cpu: Make the Intel PT LIP feature configurable sev: add sev-inject-launch-secret qom: code hardening - have bound checking while looping with integer value Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'qom/object.c')
| -rw-r--r-- | qom/object.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/qom/object.c b/qom/object.c index 1065355233..e73d70a993 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1196,11 +1196,11 @@ object_property_try_add(Object *obj, const char *name, const char *type, if (name_len >= 3 && !memcmp(name + name_len - 3, "[*]", 4)) { int i; - ObjectProperty *ret; + ObjectProperty *ret = NULL; char *name_no_array = g_strdup(name); name_no_array[name_len - 3] = '\0'; - for (i = 0; ; ++i) { + for (i = 0; i < INT16_MAX; ++i) { char *full_name = g_strdup_printf("%s[%d]", name_no_array, i); ret = object_property_try_add(obj, full_name, type, get, set, @@ -1211,6 +1211,7 @@ object_property_try_add(Object *obj, const char *name, const char *type, } } g_free(name_no_array); + assert(ret); return ret; } |