commit | 35af4592202cc4e7d7f605ce5d51dce5827cd55a | [log] [tgz] |
---|---|---|
author | Nicolas Iooss <nicolas.iooss@m4x.org> | Tue Apr 11 23:46:03 2017 +0200 |
committer | Stephen Smalley <sds@tycho.nsa.gov> | Wed Apr 12 14:48:36 2017 -0400 |
tree | 80a56c941389db23c64948a3fd12a352147b1294 | |
parent | bfe40222e2bd5955b13c83149a369335721a58d2 [diff] |
policycoreutils: newrole: always initialize pw fields In extract_pw_data(), if "getpwuid(uid)" fails, the function returns an error value without initializing main's pw.pw_name. This leads main() to call "free(pw.pw_name)" on an uninitialized value. Use memset() to initialize structure pw in main(). This issue has been found using clang's static analyzer. Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>