[libvirt] [PATCH v2] test_driver: implement virDomainGetDiskErrors

Peter Krempa pkrempa at redhat.com
Wed May 15 08:19:56 UTC 2019


On Wed, May 15, 2019 at 10:14:35 +0200, Michal Privoznik wrote:
> On 5/14/19 5:24 PM, Ilias Stamatis wrote:
> > On Tue, May 14, 2019 at 5:04 PM Michal Privoznik <mprivozn at redhat.com> wrote:

[...]

> > Because in the first loop, VIR_STRDUP might fail and send us to
> > "cleanup". But then on cleanup we iterate over the whole errors array.
> > 
> > Isn't this incorrect? Do I understand something wrong?
> 
> 
> Ah, now I get it. If user passes an array that is not zeroed out then we
> might end up passing a random pointer to free(). How about this then?

Why don't you just sanitize the user-passed memory first then?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190515/ae3fb0d5/attachment-0001.sig>


More information about the libvir-list mailing list