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
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2012-03-29 19:01:18 +0400
committerCorinna Vinschen <corinna@vinschen.de>2012-03-29 19:01:18 +0400
commit60ecc3d68b188766e53dd314b40a0eb1192425ae (patch)
tree436d30f73694d3ed1f0959f4b2905a89cf0ec48f /winsup/cygwin/sec_acl.cc
parent74daacfd319562ce79bc22e98a4d506f7cc1d413 (diff)
* sec_acl.cc (acl32): Fix potnetial crash if build_fh_name returns NULL.
Diffstat (limited to 'winsup/cygwin/sec_acl.cc')
-rw-r--r--winsup/cygwin/sec_acl.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc
index b2fd3f4d7..14cb88667 100644
--- a/winsup/cygwin/sec_acl.cc
+++ b/winsup/cygwin/sec_acl.cc
@@ -1,7 +1,7 @@
/* sec_acl.cc: Sun compatible ACL functions.
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009, 2010, 2011 Red Hat, Inc.
+ 2009, 2010, 2011, 2012 Red Hat, Inc.
Written by Corinna Vinschen <corinna@vinschen.de>
@@ -451,13 +451,13 @@ acl32 (const char *path, int cmd, int nentries, __aclent32_t *aclbufp)
fhandler_base *fh = build_fh_name (path, PC_SYM_FOLLOW | PC_KEEP_HANDLE,
stat_suffixes);
- if (fh->error ())
+ if (!fh || !fh->exists ())
+ set_errno (ENOENT);
+ else if (fh->error ())
{
debug_printf ("got %d error from build_fh_name", fh->error ());
set_errno (fh->error ());
}
- else if (!fh->exists ())
- set_errno (ENOENT);
else
res = fh->facl (cmd, nentries, aclbufp);