summaryrefslogtreecommitdiff
path: root/src/basic/calendarspec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/basic/calendarspec.c')
-rw-r--r--src/basic/calendarspec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/basic/calendarspec.c b/src/basic/calendarspec.c
index eef4ed5240..1555230e30 100644
--- a/src/basic/calendarspec.c
+++ b/src/basic/calendarspec.c
@@ -18,6 +18,7 @@
***/
#include <alloca.h>
+#include <ctype.h>
#include <errno.h>
#include <stddef.h>
#include <stdio.h>
@@ -458,6 +459,9 @@ static int parse_component_decimal(const char **p, bool usec, unsigned long *res
char *ee = NULL;
int r;
+ if (!isdigit(**p))
+ return -EINVAL;
+
errno = 0;
value = strtoul(*p, &ee, 10);
if (errno > 0)