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

Re: [Libguestfs] [PATCH v2] Fix trace segfault for non-daemon functions (RHBZ#682756).



On 07/03/11 16:46, Richard W.M. Jones wrote:
 From 7c721e4fd674c409b3eee60fe237d480afa1c5e2 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones<rjones redhat com>
Date: Mon, 7 Mar 2011 15:55:56 +0000
Subject: [PATCH] Fix trace segfault for non-daemon functions (RHBZ#682756).

Previously we expanded the code for 'trace_return' unconditionally for
all non-daemon functions.  However this code was not prepared to
handle all error conditions, and in fact would segfault if it tried to
print RStringList or RHashtable where r == NULL.

We need to make the code conditional on the return value, calling
either 'trace_return' or 'trace_return_error' as appropriate.

Note the difficult case for RConstOptString which returns NULL in
non-error cases.
---
  generator/generator_c.ml |   47 +++++++++++++++++++++++++++++----------------
  1 files changed, 30 insertions(+), 17 deletions(-)

ACK.

Matt
--
Matthew Booth, RHCA, RHCSS
Red Hat Engineering, Virtualisation Team

GPG ID:  D33C3490
GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490


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