[PATCH] Avoiding Dereferencing of NULL pointer

Darren Tucker dtucker at dtucker.net
Fri Oct 4 13:56:19 AEST 2019


Applied a variant, thanks.

On Thu, 3 Oct 2019 at 18:18, krishnaiah bommu <krishnaiah.bommu at intel.com>
wrote:

> [...]
> -       struct tm *gtm;
> +       struct tm *gtm = NULL;
>

Since it's unconditionally assigned below, initialising it is not necessary.

+       if (!gtm)
> +               return (-1);
>

The OpenBSD style guide (http://man.openbsd.org/style.9) advises not using
negations on things that aren't boolean.

Thanks.
-- 
Darren Tucker (dtucker at dtucker.net)
GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860  37F4 9357 ECEF 11EA A6FA (new)
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.


More information about the openssh-unix-dev mailing list