* sec_acl.cc (acl32): Fix potnetial crash if build_fh_name returns NULL.

This commit is contained in:
Corinna Vinschen 2012-03-29 15:01:18 +00:00
parent 74daacfd31
commit 60ecc3d68b
2 changed files with 8 additions and 4 deletions

View File

@ -1,3 +1,7 @@
2012-03-29 Corinna Vinschen <corinna@vinschen.de>
* sec_acl.cc (acl32): Fix potnetial crash if build_fh_name returns NULL.
2012-03-29 Christopher Faylor <me.cygwin2012@cgf.cx>
* exceptions.cc (ctrl_c_handler): Don't generate a SIGINT if we've

View File

@ -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);