diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-03-06 08:56:13 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-03-06 08:56:13 +0200 |
commit | f237fee83b8ed6553bdc8ad21862d373dec7e074 (patch) | |
tree | 1c77fc8b9303faa247c293cd5355f1fc2bdf49df | |
parent | ff847bb1ed851ee4285fdd3768e379855c40483c (diff) | |
download | mailutils-f237fee83b8ed6553bdc8ad21862d373dec7e074.tar.gz mailutils-f237fee83b8ed6553bdc8ad21862d373dec7e074.tar.bz2 |
Bugfix
* libproto/mbox/mbox.c (restore_date): Fix possible uninitialized
memory access.
-rw-r--r-- | libproto/mbox/mbox.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libproto/mbox/mbox.c b/libproto/mbox/mbox.c index e8440e912..1afdc0ee2 100644 --- a/libproto/mbox/mbox.c +++ b/libproto/mbox/mbox.c @@ -857,13 +857,17 @@ int restore_date (mu_message_t msg, char **pret) { mu_header_t hdr; - const char *s; + const char *s = NULL; char *date = NULL; struct tm tm; struct mu_timezone tz; if (mu_message_get_header (msg, &hdr) == 0) - mu_header_sget_value (hdr, MU_HEADER_DATE, &s); + { + int rc = mu_header_sget_value (hdr, MU_HEADER_DATE, &s); + if (rc && rc != MU_ERR_NOENT) + return rc; + } if (s && mu_scan_datetime (s, MU_DATETIME_SCAN_RFC822, &tm, &tz, NULL) == 0) { |