* src/editfns.c (tzlookup): Fix storage lifetime bug when
INTEGERP (zone) && settz. Problem found by Coverity Scan.
static timezone_t
tzlookup (Lisp_Object zone, bool settz)
{
+ static char const tzbuf_format[] = "<%+.*"pI"d>%s%"pI"d:%02d:%02d";
+ char const *trailing_tzbuf_format = tzbuf_format + sizeof "<%+.*"pI"d" - 1;
+ char tzbuf[sizeof tzbuf_format + 2 * INT_STRLEN_BOUND (EMACS_INT)];
char const *zone_string;
timezone_t new_tz;
}
else
{
- static char const tzbuf_format[] = "<%+.*"pI"d>%s%"pI"d:%02d:%02d";
- char const *trailing_tzbuf_format = tzbuf_format + sizeof "<%+.*"pI"d" - 1;
- char tzbuf[sizeof tzbuf_format + 2 * INT_STRLEN_BOUND (EMACS_INT)];
bool plain_integer = INTEGERP (zone);
if (EQ (zone, Qwall))