commit 107ad6eb2a94d9623f325cfd87ebff8bc9a76148
parent 719cc8b7f9011a720d30308b99edc456a2943ca6
Author: Christian Grothoff <christian@grothoff.org>
Date: Fri, 13 Dec 2024 15:00:54 +0100
handle NULL nicely
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/util/pin.c b/src/util/pin.c
@@ -34,8 +34,9 @@ ANASTASIS_scan_pin (const char *as,
char dummy;
char s[16];
- if ( (NULL != as) &&
- (0 == strncasecmp ("A-", as, 2)) )
+ if (NULL == as)
+ return false;
+ if (0 == strncasecmp ("A-", as, 2))
as += 2; /* skip "A-" prefix if present */
if (strlen (as) != 18)
return false;