Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2012-07-04 21:30:55 +0400
committerChristopher Faylor <me@cgf.cx>2012-07-04 21:30:55 +0400
commitea51d3d4250a1b51efed8fc8442381041d59441d (patch)
treee9086af5c78e9d66e8317b20047a7b4367f38a3d /winsup
parent85b2b14e7a9cf343d287f19eb0105123a4f540b0 (diff)
* dcrt0.cc (build_argv): Guard against NULL pointer dereference found by Clang.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/dcrt0.cc3
2 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index ba9464d26..e041729ca 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2012-07-04 Christopher Faylor <me.cygwin2012@cgf.cx>
+ * dcrt0.cc (build_argv): Guard against NULL pointer dereference found
+ by Clang.
+
+2012-07-04 Christopher Faylor <me.cygwin2012@cgf.cx>
+
* exceptions.cc (setup_handler): Remove unneeded assignment found by
Clang.
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index e28aecde9..70b962889 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -353,7 +353,8 @@ build_argv (char *cmd, char **&argv, int &argc, int winshell)
}
}
- argv[argc] = NULL;
+ if (argv)
+ argv[argc] = NULL;
debug_printf ("argc %d", argc);
}