aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gsm/gsm23003.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gsm/gsm23003.c b/src/gsm/gsm23003.c
index 004e20ff..3c09acac 100644
--- a/src/gsm/gsm23003.c
+++ b/src/gsm/gsm23003.c
@@ -33,6 +33,8 @@ static bool is_n_digits(const char *str, int min_digits, int max_digits)
/* Use unsigned char * to avoid a compiler warning of
* "error: array subscript has type 'char' [-Werror=char-subscripts]" */
const unsigned char *pos = (const unsigned char *)str;
+ if (!pos)
+ return min_digits < 1;
for (len = 0; *pos && len < max_digits; len++, pos++)
if (!isdigit(*pos))
return false;