diff options
Diffstat (limited to 'logsrvd/logsrvd_journal.c')
-rw-r--r-- | logsrvd/logsrvd_journal.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/logsrvd/logsrvd_journal.c b/logsrvd/logsrvd_journal.c index 354d71c80..0983d1f67 100644 --- a/logsrvd/logsrvd_journal.c +++ b/logsrvd/logsrvd_journal.c @@ -268,6 +268,11 @@ journal_seek(struct timespec *target, struct connection_closure *closure) if (msg_len > bufsize) { bufsize = sudo_pow2_roundup(msg_len); + if (bufsize < msg_len) { + /* overflow */ + closure->errstr = _("unable to allocate memory"); + break; + } free(buf); if ((buf = malloc(bufsize)) == NULL) { closure->errstr = _("unable to allocate memory"); |