summaryrefslogtreecommitdiff
path: root/src/certtool-cfg.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2015-03-05 18:56:34 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2015-03-05 19:00:40 +0100
commit3a26b1a35e336c0ec4f390713057f7cb0f21b73f (patch)
tree3513b2ec75c4c9a70901b6343b9bd40f5f6dee16 /src/certtool-cfg.c
parent0f49927d8e35a5ccc04e5db8b0073e0162ae6a13 (diff)
downloadgnutls-3a26b1a35e336c0ec4f390713057f7cb0f21b73f.tar.gz
certtool: exit when there is an overflow in parsing days
Diffstat (limited to 'src/certtool-cfg.c')
-rw-r--r--src/certtool-cfg.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/certtool-cfg.c b/src/certtool-cfg.c
index e212fc476c..332b8b2e96 100644
--- a/src/certtool-cfg.c
+++ b/src/certtool-cfg.c
@@ -1198,7 +1198,7 @@ time_t now = time(NULL);
if (secs != (time_t)-1) {
if (INT_MULTIPLY_OVERFLOW(secs, 24*60*60)) {
- secs = -1;
+ goto overflow;
} else {
secs *= 24*60*60;
}
@@ -1206,13 +1206,16 @@ time_t now = time(NULL);
if (secs != (time_t)-1) {
if (INT_ADD_OVERFLOW(secs, now)) {
- secs = -1;
+ goto overflow;
} else {
secs += now;
}
}
return secs;
+ overflow:
+ fprintf(stderr, "Overflow while parsing days\n");
+ exit(1);
}
static