[SSSD] [PATCH] localauth plugin: fix coverity warning

Jakub Hrozek jhrozek at redhat.com
Tue May 26 08:38:32 UTC 2015


On Mon, May 25, 2015 at 10:53:27AM +0200, Pavel Březina wrote:
> 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.

* master: cc98e19b424861c2a7fd91e0d657d82c1dbf3059



More information about the sssd-devel mailing list