Unverified Commit e357d5a1 by Christian Brauner Committed by GitHub

Merge pull request #2399 from 2xsec/bugfix

coverity: #1436916
parents 2b65c74c db8b325a
...@@ -101,8 +101,10 @@ static bool lookup_user(const char *optarg, uid_t *uid) ...@@ -101,8 +101,10 @@ static bool lookup_user(const char *optarg, uid_t *uid)
if (sscanf(optarg, "%u", uid) < 1) { if (sscanf(optarg, "%u", uid) < 1) {
/* not a uid -- perhaps a username */ /* not a uid -- perhaps a username */
if (sscanf(optarg, "%s", name) < 1) if (sscanf(optarg, "%s", name) < 1) {
free(buf);
return false; return false;
}
ret = getpwnam_r(name, &pwent, buf, bufsize, &pwentp); ret = getpwnam_r(name, &pwent, buf, bufsize, &pwentp);
if (!pwentp) { if (!pwentp) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment