From patchwork Wed Jun 10 17:38:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 7101 Received: (qmail 43643 invoked by alias); 10 Jun 2015 17:38:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 42995 invoked by uid 89); 10 Jun 2015 17:38:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 10 Jun 2015 17:38:24 +0000 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 (Postfix) with ESMTPS id 7DE97C9437 for ; Wed, 10 Jun 2015 17:38:23 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-44.ams2.redhat.com [10.36.116.44]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5AHcJJw025917 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 10 Jun 2015 13:38:22 -0400 Date: Wed, 10 Jun 2015 19:38:19 +0200 From: Jan Kratochvil To: Gary Benson , Pedro Alves Cc: gdb-patches@sourceware.org Subject: [commit#2] [patch] gdbserver and its #FIXED version="1.0" Message-ID: <20150610173819.GA24034@host1.jankratochvil.net> References: <55786327.9060002@redhat.com> <20150608090756.GA5989@blade.nx> <20150610163121.GA2683@host1.jankratochvil.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20150610163121.GA2683@host1.jankratochvil.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes On Wed, 10 Jun 2015 18:31:21 +0200, Jan Kratochvil wrote: > On Mon, 08 Jun 2015 11:07:56 +0200, Gary Benson wrote: > > The "if (version)" should likely be "if (version != NULL)". I forgot about this part. Checked in as obvious. Jan gdb/ChangeLog 2015-06-10 Jan Kratochvil Code cleanup. * solib-target.c (library_list_start_list): Use explicit NULL comparison. --- gdb/ChangeLog | 6 ++++++ gdb/solib-target.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 83845f4..5b19052 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2015-06-10 Jan Kratochvil + Code cleanup. + * solib-target.c (library_list_start_list): Use explicit NULL + comparison. + +2015-06-10 Jan Kratochvil + * solib-target.c (library_list_start_list): Do not dereference variable version in its initialization. Make the VERSION check handle NULL. diff --git a/gdb/solib-target.c b/gdb/solib-target.c index 891e572..f14363a 100644 --- a/gdb/solib-target.c +++ b/gdb/solib-target.c @@ -149,7 +149,7 @@ library_list_start_list (struct gdb_xml_parser *parser, struct gdb_xml_value *version = xml_find_attribute (attributes, "version"); /* #FIXED attribute may be omitted, Expat returns NULL in such case. */ - if (version) + if (version != NULL) { const char *string = version->value;