From 1fc747f37ac6d74b617dddcb0153cc47f0d4fb4d Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 23 Jan 2013 02:06:44 +0000 Subject: [PATCH] * miscfuncs.cc (__import_address): Avoid NULL explicitly. --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/miscfuncs.cc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 3bd365f85..48870ae1c 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2013-01-22 Christopher Faylor + + * miscfuncs.cc (__import_address): Avoid NULL explicitly. + 2013-01-22 Christopher Faylor * miscfuncs.cc (__import_address): Avoid treating random instructions diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc index 4f9c9df9d..8e954b39f 100644 --- a/winsup/cygwin/miscfuncs.cc +++ b/winsup/cygwin/miscfuncs.cc @@ -437,7 +437,7 @@ slashify (const char *src, char *dst, bool trailing_slash_p) void * __reg1 __import_address (void *imp) { - if (*((uint16_t *) imp) != 0x25ff) + if (!imp || *((uint16_t *) imp) != 0x25ff) return NULL; myfault efault; if (efault.faulted ())