From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2912 invoked by alias); 7 Aug 2013 09:23:40 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 2879 invoked by uid 89); 7 Aug 2013 09:23:39 -0000 X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RDNS_NONE autolearn=no version=3.3.1 Received: from Unknown (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 07 Aug 2013 09:23:08 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1V6zxN-0002Ow-2h from Muhammad_Waqas@mentor.com for gdb-patches@sourceware.org; Wed, 07 Aug 2013 02:23:01 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 7 Aug 2013 02:23:00 -0700 Received: from [137.202.157.111] (147.34.91.1) by SVR-ORW-FEM-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server (TLS) id 14.2.247.3; Wed, 7 Aug 2013 02:22:59 -0700 Message-ID: <520211EF.8070801@codesourcery.com> Date: Wed, 07 Aug 2013 09:23:00 -0000 From: Muhammad Waqas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 MIME-Version: 1.0 To: Subject: Re: [PATCH] Fix PR gdb/15678 Typing "enable count" crashes gdb References: <52020CBB.10502@codesourcery.com> In-Reply-To: <52020CBB.10502@codesourcery.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2013-08/txt/msg00184.txt.bz2 On 08/07/2013 02:00 PM, Muhammad Waqas wrote: > Patch for http://sourceware.org/bugzilla/show_bug.cgi?id=15678 > > gdb crashes when "enable count" command is entered. > > In function enable_count_command no checks for args if it's null > or not and pass it to get_number function where gdb crashed > while doing dereference to null pointer. > So I added code to check if args is null then put > error to user Arguments are need. > > Changlog > > 2013-08-07 Muhammad Waqas > > PR gdb/15678 > * breakpoint.c (enable_count_command): Fix gdb crash if args > is null. > > Index: breakpoint.c > =================================================================== > RCS file: /cvs/src/src/gdb/breakpoint.c,v > retrieving revision 1.773 > diff -u -p -r1.773 breakpoint.c > --- breakpoint.c 24 Jul 2013 19:50:32 -0000 1.773 > +++ breakpoint.c 7 Aug 2013 08:46:02 -0000 > @@ -14740,9 +14740,16 @@ do_map_enable_count_breakpoint (struct b > static void > enable_count_command (char *args, int from_tty) > { > - int count = get_number (&args); > - > - map_breakpoint_numbers (args, do_map_enable_count_breakpoint, &count); > + if (args == NULL) > + { > + error_no_arg (_("count, breakpoints")); > + } > + else > + { > + int count = get_number (&args); > + > + map_breakpoint_numbers (args, do_map_enable_count_breakpoint, > &count); > + } > } > > static void > Sorry every one I with draw this patch I didn't noticed it is already fixed.