CC: | vovkasm [...] gmail.com |
Subject: | tzset is broken |
See patch.
Subject: | 0001-Fix-sort-of-use-after-free-but-with-static-memory-bu.patch |
From 79f71660a3c7308646170ab036581c08d822d689 Mon Sep 17 00:00:00 2001
From: Vladimir Timofeev <vovkasm@gmail.com>
Date: Thu, 30 Jun 2016 16:21:51 +0300
Subject: [PATCH] Fix sort of use-after-free, but with static memory, buffer
lzname was used ouside its scope
---
src/panda/time/timezone.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/panda/time/timezone.cc b/src/panda/time/timezone.cc
index ee88fb2..e99397b 100644
--- a/src/panda/time/timezone.cc
+++ b/src/panda/time/timezone.cc
@@ -75,8 +75,8 @@ static const tz* _tzget (const char* zonename) {
tz* zone = new tz();
zone->is_local = false;
+ char lzname[TZNAME_MAX+1];
if (zonename == NULL || zonename[0] == '\0') {
- char lzname[TZNAME_MAX+1];
tz_lzname(lzname);
zonename = lzname;
zone->is_local = true;
--
2.9.0