qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] util/error: Fix use-after-free errors reported by Coverity


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] util/error: Fix use-after-free errors reported by Coverity
Date: Thu, 6 Apr 2023 17:55:53 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.1

On 6/4/23 17:43, Stefan Berger wrote:
Fix use-after-free errors in the code path that called error_handle(). A
call to error_handle() will now either free the passed Error 'err' or
assign it to '*errp' if '*errp' is currently NULL. This ensures that 'err'
either has been freed or is assigned to '*errp' if this function returns.
Adjust the two callers of this function to not assign the 'err' to '*errp'
themselves, since this is now handled by error_handle().

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
---
  util/error.c | 10 ++++------
  1 file changed, 4 insertions(+), 6 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




reply via email to

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