From 559e75c07a4bd1d17dd4d7aa05774773ac0c03cc Mon Sep 17 00:00:00 2001 From: Michael Chastain Date: Sun, 18 Mar 2001 21:35:58 +0000 Subject: [PATCH] 2001-03-17 Michael Chastain * win32-nat.c (child_attach): check args for NULL before passing to strtoul. This fixes PR gdb/43. --- gdb/ChangeLog | 5 +++++ gdb/win32-nat.c | 3 ++- gdb/windows-nat.c | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 10cea66e71e..76cf356669d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2001-03-17 Michael Chastain + + * win32-nat.c (child_attach): check args for NULL before passing + to strtoul. This fixes PR gdb/43. + 2001-03-17 Mark Kettenis * i387-nat.h: Doc Fix. diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c index f0d97fa6f26..277b473456b 100644 --- a/gdb/win32-nat.c +++ b/gdb/win32-nat.c @@ -1015,11 +1015,12 @@ static void child_attach (char *args, int from_tty) { BOOL ok; - DWORD pid = strtoul (args, 0, 0); + DWORD pid; if (!args) error_no_arg ("process-id to attach"); + pid = strtoul (args, 0, 0); ok = DebugActiveProcess (pid); if (!ok) diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index f0d97fa6f26..277b473456b 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -1015,11 +1015,12 @@ static void child_attach (char *args, int from_tty) { BOOL ok; - DWORD pid = strtoul (args, 0, 0); + DWORD pid; if (!args) error_no_arg ("process-id to attach"); + pid = strtoul (args, 0, 0); ok = DebugActiveProcess (pid); if (!ok) -- 2.30.2