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 | |||
857 | restore_date (mu_message_t msg, char **pret) | 857 | restore_date (mu_message_t msg, char **pret) |
858 | { | 858 | { |
859 | mu_header_t hdr; | 859 | mu_header_t hdr; |
860 | const char *s; | 860 | const char *s = NULL; |
861 | char *date = NULL; | 861 | char *date = NULL; |
862 | struct tm tm; | 862 | struct tm tm; |
863 | struct mu_timezone tz; | 863 | struct mu_timezone tz; |
864 | 864 | ||
865 | if (mu_message_get_header (msg, &hdr) == 0) | 865 | if (mu_message_get_header (msg, &hdr) == 0) |
866 | mu_header_sget_value (hdr, MU_HEADER_DATE, &s); | 866 | { |
867 | int rc = mu_header_sget_value (hdr, MU_HEADER_DATE, &s); | ||
868 | if (rc && rc != MU_ERR_NOENT) | ||
869 | return rc; | ||
870 | } | ||
867 | 871 | ||
868 | if (s && mu_scan_datetime (s, MU_DATETIME_SCAN_RFC822, &tm, &tz, NULL) == 0) | 872 | if (s && mu_scan_datetime (s, MU_DATETIME_SCAN_RFC822, &tm, &tz, NULL) == 0) |
869 | { | 873 | { |