* [RFA] gdb/win32-nat.c: check for NULL before calling strtoul
@ 2001-03-17 23:52 Michael Elizabeth Chastain
2001-03-18 12:46 ` Christopher Faylor
0 siblings, 1 reply; 2+ messages in thread
From: Michael Elizabeth Chastain @ 2001-03-17 23:52 UTC (permalink / raw)
To: gdb-patches
This patch fixes PR gdb/43, a coding error in child_attach. Cygwin's
implementation of strtoul dumps core if the input pointer is NULL.
This means gdb dumps core on a plain "attach" command with no arguments.
This fix enables the test script gdb.base/default.exp to run to
completion.
I tested this on Windows 2000 Professional + cygwin 1.1.8. I gave a
plain "attach" command by hand and also ran gdb.base/default.exp.
OK to apply?
Michael
===
2001-03-17 Michael Chastain <chastain@redhat.com>
* win32-nat.c (child_attach): check args for NULL before passing
to strtoul. This fixes PR gdb/43.
Index: gdb/win32-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/win32-nat.c,v
retrieving revision 1.25
diff -c -3 -p -r1.25 win32-nat.c
*** gdb/win32-nat.c 2001/03/06 08:21:18 1.25
--- gdb/win32-nat.c 2001/03/18 07:40:02
*************** static void
*** 1015,1025 ****
child_attach (char *args, int from_tty)
{
BOOL ok;
! DWORD pid = strtoul (args, 0, 0);
if (!args)
error_no_arg ("process-id to attach");
ok = DebugActiveProcess (pid);
if (!ok)
--- 1015,1026 ----
child_attach (char *args, int from_tty)
{
BOOL ok;
! DWORD pid;
if (!args)
error_no_arg ("process-id to attach");
+ pid = strtoul (args, 0, 0);
ok = DebugActiveProcess (pid);
if (!ok)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RFA] gdb/win32-nat.c: check for NULL before calling strtoul
2001-03-17 23:52 [RFA] gdb/win32-nat.c: check for NULL before calling strtoul Michael Elizabeth Chastain
@ 2001-03-18 12:46 ` Christopher Faylor
0 siblings, 0 replies; 2+ messages in thread
From: Christopher Faylor @ 2001-03-18 12:46 UTC (permalink / raw)
To: gdb-patches
On Sat, Mar 17, 2001 at 11:52:23PM -0800, Michael Elizabeth Chastain wrote:
>This patch fixes PR gdb/43, a coding error in child_attach. Cygwin's
>implementation of strtoul dumps core if the input pointer is NULL.
>This means gdb dumps core on a plain "attach" command with no arguments.
>
>This fix enables the test script gdb.base/default.exp to run to
>completion.
>
>I tested this on Windows 2000 Professional + cygwin 1.1.8. I gave a
>plain "attach" command by hand and also ran gdb.base/default.exp.
>
>OK to apply?
Yes.
Thanks,
cgf
>2001-03-17 Michael Chastain <chastain@redhat.com>
>
> * win32-nat.c (child_attach): check args for NULL before passing
> to strtoul. This fixes PR gdb/43.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-03-18 12:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-17 23:52 [RFA] gdb/win32-nat.c: check for NULL before calling strtoul Michael Elizabeth Chastain
2001-03-18 12:46 ` Christopher Faylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox