qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 for-1.4] tests/test-string-input-visitor: Han


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v2 for-1.4] tests/test-string-input-visitor: Handle errors provoked by fuzz test
Date: Tue, 05 Feb 2013 21:48:28 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2

Am 05.02.2013 21:44, schrieb Peter Maydell:
> It's OK and expected for visitors to return errors when presented with
> the fuzz test's random data. Since the fuzzer doesn't care about
> errors, we pass in NULL rather than an Error**. This fixes a bug in
> the fuzzer where it was passing the same Error** into each visitor,
> with the effect that once one visitor returned an error, each later
> visitor would notice that it had been passed in an Error** representing
> an already set error, and do nothing.
> 
> For the case of visit_type_str() we also need to handle the case where
> an error means that the visitor doesn't set our char*. We initialize
> the pointer to NULL so we can safely g_free() it regardless of whether
> the visitor allocated a string for us or not.
> 
> This fixes a problem where this test failed the MacOSX malloc()
> consistency checks and might segfault on other platforms [due
> to calling free() on an uninitialized pointer variable when
> visit_type_str() failed.].
> 
> Signed-off-by: Peter Maydell <address@hidden>

Reviewed-by: Andreas Färber <address@hidden>

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]