summary refs log tree commit diff
path: root/time/tzset.c
diff options
context:
space:
mode:
Diffstat (limited to 'time/tzset.c')
-rw-r--r--time/tzset.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/time/tzset.c b/time/tzset.c
index d115bae0be..160f5ad460 100644
--- a/time/tzset.c
+++ b/time/tzset.c
@@ -201,7 +201,12 @@ parse_tzname (const char **tzp, int whichrule)
       if (*p++ != '>' || len < 3)
 	return false;
     }
-  tz_rules[whichrule].name = __tzstring_len (start, len);
+
+  const char *name = __tzstring_len (start, len);
+  if (name == NULL)
+    return false;
+  tz_rules[whichrule].name = name;
+
   *tzp = p;
   return true;
 }