[PATCH] Fix null pointer dereference

Werner Koch wk at gnupg.org
Mon Jan 26 11:29:28 CET 2015


On Sun, 25 Jan 2015 20:18, git at internot.info said:

> 'strpbrk' may return NULL.

But not here because the do--while guarantees that LINE is terminated by
a LF and thus after that do-while

>        for (allowed=line; spacep (allowed); allowed++)
>          ;
>        p = strpbrk (allowed, " :\n");
> -      if (!*p || p == allowed)
> +      if (!p || p == allowed)

the strpbrk will at least detect the LF and thus never return a NULL.


Salam-Shalom,

   Werner

-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.




More information about the Gnupg-devel mailing list