aboutsummaryrefslogtreecommitdiff
path: root/winsup/utils/cygcheck.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2009-05-04 18:51:08 +0000
committerChristopher Faylor <me@cgf.cx>2009-05-04 18:51:08 +0000
commit3227665e1995fe103b31d17fd4a2cddcd6cdde97 (patch)
treedde7eb8a3579cf020ac2c4f57a840f6f4d18329e /winsup/utils/cygcheck.cc
parent143cb0bed5619b937e66c87bd41dcda7baa39da4 (diff)
downloadnewlib-3227665e1995fe103b31d17fd4a2cddcd6cdde97.zip
newlib-3227665e1995fe103b31d17fd4a2cddcd6cdde97.tar.gz
newlib-3227665e1995fe103b31d17fd4a2cddcd6cdde97.tar.bz2
* cygcheck.cc (find_app_on_path): Avoid using NULL pointer if find_on_path
doesn't find the app on the path.
Diffstat (limited to 'winsup/utils/cygcheck.cc')
-rw-r--r--winsup/utils/cygcheck.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc
index c3e9a95..3b38603 100644
--- a/winsup/utils/cygcheck.cc
+++ b/winsup/utils/cygcheck.cc
@@ -840,6 +840,9 @@ find_app_on_path (const char *app, bool showall = false)
{
const char *papp = find_on_path (app, ".exe", showall, false, true);
+ if (!papp)
+ return NULL;
+
wide_path wpath (papp);
HANDLE fh =
CreateFileW (wpath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,