git: 55572cff58c4 - main - tzcode: Fully initialize structs before use.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 14 Jan 2023 17:20:07 UTC
The branch main has been updated by des:
URL: https://cgit.FreeBSD.org/src/commit/?id=55572cff58c4208a9e532356a245676b8eed6a3e
commit 55572cff58c4208a9e532356a245676b8eed6a3e
Author: Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2023-01-13 14:59:05 +0000
Commit: Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2023-01-14 17:16:52 +0000
tzcode: Fully initialize structs before use.
Reported by: Coverity (CID 1502542, 1502548)
MFC after: 1 week
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38037
---
contrib/tzcode/zic.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/tzcode/zic.c b/contrib/tzcode/zic.c
index 64937d9b0d36..812814b70cfa 100644
--- a/contrib/tzcode/zic.c
+++ b/contrib/tzcode/zic.c
@@ -1842,7 +1842,7 @@ getsave(char *field, bool *isdst)
static void
inrule(char **fields, int nfields)
{
- struct rule r;
+ struct rule r = { 0 };
if (nfields != RULE_FIELDS) {
error(_("wrong number of fields on Rule line"));
@@ -1921,7 +1921,7 @@ inzsub(char **fields, int nfields, bool iscont)
{
register char * cp;
char * cp1;
- struct zone z;
+ struct zone z = { 0 };
int format_len;
register int i_stdoff, i_rule, i_format;
register int i_untilyear, i_untilmonth;