mirror of
git://git.gnupg.org/gnupg.git
synced 2025-05-14 08:13:25 +02:00
Fix access to the bintoasc mapping in the libksba support.
* common/ksba-io-support.c (has_only_base64): Use memchr since calling strchr on a non-NUL terminated string is undefined behavior. -- Signed-off-by: Collin Funk <collin.funk1@gmail.com> This patch has been stripped from Colin's original patch because this is not just about a warning but an actual bug. That bug was introduced in 2003 by me. - wk
This commit is contained in:
parent
d90b290f97
commit
3c5a143945
@ -174,7 +174,7 @@ has_only_base64 (const unsigned char *line, int linelen)
|
||||
{
|
||||
if (*line == '\n' || (linelen > 1 && *line == '\r' && line[1] == '\n'))
|
||||
break;
|
||||
if ( !strchr (bintoasc, *line) )
|
||||
if ( !memchr (bintoasc, *line, sizeof (bintoasc)) )
|
||||
return 0;
|
||||
}
|
||||
return 1; /* yes */
|
||||
|
Loading…
x
Reference in New Issue
Block a user