diff options
author | Collin Funk <[email protected]> | 2025-04-30 08:36:18 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2025-04-30 08:41:29 +0000 |
commit | 33d418fd34b55bdd30b0dc1a4ab2fe41cc6d2170 (patch) | |
tree | ed200ba6cc8a7d015373c1006750682342fc71d3 | |
parent | keyboxd: Searching UpperCaseAddress. (diff) | |
download | gnupg-33d418fd34b55bdd30b0dc1a4ab2fe41cc6d2170.tar.gz gnupg-33d418fd34b55bdd30b0dc1a4ab2fe41cc6d2170.zip |
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 <[email protected]>
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
-rw-r--r-- | common/ksba-io-support.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/ksba-io-support.c b/common/ksba-io-support.c index 352485ffa..ff5e49531 100644 --- a/common/ksba-io-support.c +++ b/common/ksba-io-support.c @@ -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 */ |