On 05/21/2015 04:29 PM, Pavel Reichl wrote:
Hello,
please see attached patch. The patch fixes coverity warning:
Error: FORWARD_NULL (CWE-476): [#def1]
sssd-1.12.90/src/krb5_plugin/sssd_krb5_localauth_plugin.c:111:
assign_zero: Assigning: "pwd.pw_name" = "NULL".
sssd-1.12.90/src/krb5_plugin/sssd_krb5_localauth_plugin.c:142:
var_deref_model: Passing null pointer "pwd.pw_name" to "strdup",
which
dereferences it.
# 140| }
# 141|
# 142|-> str = strdup(pwd.pw_name);
# 143| if (str == NULL) {
# 144| ret = ENOMEM;
I'm not sure if it's false positive or not.
Thanks!
Hi,
it is false positive since pw_name can't be NULL. But the patch won't do
any harm.
Ack.