From patchwork Wed Oct 5 13:21:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 117835 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6B03DB6F97 for ; Thu, 6 Oct 2011 00:22:43 +1100 (EST) Received: from localhost ([::1]:55141 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBRQf-00037i-IG for incoming@patchwork.ozlabs.org; Wed, 05 Oct 2011 09:22:33 -0400 Received: from eggs.gnu.org ([140.186.70.92]:51716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBRQT-00037W-AJ for qemu-devel@nongnu.org; Wed, 05 Oct 2011 09:22:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBRQS-0001iD-Fk for qemu-devel@nongnu.org; Wed, 05 Oct 2011 09:22:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBRQS-0001i8-7R for qemu-devel@nongnu.org; Wed, 05 Oct 2011 09:22:20 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p95DMJh2013157 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 5 Oct 2011 09:22:19 -0400 Received: from localhost (ovpn-113-108.phx2.redhat.com [10.3.113.108]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p95DMIqh003006; Wed, 5 Oct 2011 09:22:19 -0400 From: Luiz Capitulino To: aliguori@us.ibm.com Date: Wed, 5 Oct 2011 10:21:46 -0300 Message-Id: <1317820931-25872-2-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1317820931-25872-1-git-send-email-lcapitulino@redhat.com> References: <1317820931-25872-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 01/26] error: let error_is_type take a NULL error X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Anthony Liguori Reported-by: Luiz Capitulino Signed-off-by: Anthony Liguori Signed-off-by: Luiz Capitulino --- error.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/error.c b/error.c index b802752..68c0039 100644 --- a/error.c +++ b/error.c @@ -97,6 +97,10 @@ bool error_is_type(Error *err, const char *fmt) char *ptr; char *end; + if (!err) { + return false; + } + ptr = strstr(fmt, "'class': '"); assert(ptr != NULL); ptr += strlen("'class': '");