-
Stefan Berger authored
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(). Fixes: commit 3ffef1a5 ("error: add global &error_warn destination") Signed-off-by:
Stefan Berger <stefanb@linux.ibm.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20230406154347.4100700-1-stefanb@linux.ibm.com
Stefan Berger authoredFix 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(). Fixes: commit 3ffef1a5 ("error: add global &error_warn destination") Signed-off-by:
Stefan Berger <stefanb@linux.ibm.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20230406154347.4100700-1-stefanb@linux.ibm.com