[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] tests: unit: add NULL-pointer check
From: |
Alex Bennée |
Subject: |
Re: [PATCH] tests: unit: add NULL-pointer check |
Date: |
Mon, 05 Sep 2022 16:19:36 +0100 |
User-agent: |
mu4e 1.9.0; emacs 28.1.91 |
Paolo Bonzini <pbonzini@redhat.com> writes:
> In CID 1432593, Coverity complains that the result of qdict_crumple()
> might leak if it is not a dictionary. This is not a practical concern
> since the test would fail immediately with a NULL pointer dereference
> in qdict_size().
>
> However, it is not nice to depend on qdict_size() crashing, so add an
> explicit assertion that that the crumpled object was indeed a dictionary.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
--
Alex Bennée