summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common.c b/src/common.c
index 744d0ad2..b62e34c7 100644
--- a/src/common.c
+++ b/src/common.c
@@ -584,6 +584,10 @@ gboolean is_valid_pin(const char *pin)
{
unsigned int i;
+ /* Pin must not be empty */
+ if (pin == NULL || pin[0] == '\0')
+ return FALSE;
+
for (i = 0; i < strlen(pin); i++)
if (pin[i] < '0' || pin[i] > '9')
return FALSE;