Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:GA
p11-kit.3050
trust-Fix-segfaults-in-expand_homedir-when-pw_d...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File trust-Fix-segfaults-in-expand_homedir-when-pw_dir-NULL.patch of Package p11-kit.3050
Index: p11-kit-0.20.3/common/path.c =================================================================== --- p11-kit-0.20.3.orig/common/path.c +++ p11-kit-0.20.3/common/path.c @@ -133,18 +133,18 @@ expand_homedir (const char *remainder) #ifdef OS_UNIX char buf[1024]; struct passwd pws; - struct passwd *pwd; - int error = 0; + struct passwd *pwd = NULL; + int error; int ret; + error = 0; ret = getpwuid_r (getuid (), &pws, buf, sizeof (buf), &pwd); - if (ret == 0 && !pwd) { - ret = -1; - errno = ESRCH; - } - if (ret < 0) { - error = errno; - p11_message_err (errno, "couldn't lookup home directory for user %d", getuid ()); + if (pwd == NULL) { + if (ret == 0) + error = ESRCH; + else + error = errno; + p11_message_err (error, "couldn't lookup home directory for user %d", getuid ()); errno = error; return NULL; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor