src/core/ngx_times.c:119: error: Buffer Overrun L3
  Offset: [-6, 6] Size: 7.

src/core/ngx_times.c:113:5: <Offset trace>
111.     tp->msec = msec;
112. 
113.     ngx_gmtime(sec, &gmt);
         ^
114. 
115. 

src/core/ngx_times.c:113:5: Call
111.     tp->msec = msec;
112. 
113.     ngx_gmtime(sec, &gmt);
         ^
114. 
115. 

src/core/ngx_times.c:278:1: Parameter `t`
  276. 
  277. 
  278. void
       ^
  279. ngx_gmtime(time_t t, ngx_tm_t *tp)
  280. {

src/core/ngx_times.c:286:5: Assignment
  284.     /* the calculation is valid for positive time_t only */
  285. 
  286.     n = (ngx_uint_t) t;
           ^
  287. 
  288.     days = n / 86400;

src/core/ngx_times.c:288:5: Assignment
  286.     n = (ngx_uint_t) t;
  287. 
  288.     days = n / 86400;
           ^
  289. 
  290.     /* January 1, 1970 was Thursday */

src/core/ngx_times.c:292:5: Assignment
  290.     /* January 1, 1970 was Thursday */
  291. 
  292.     wday = (4 + days) % 7;
           ^
  293. 
  294.     n %= 86400;

src/core/ngx_times.c:367:5: Assignment
  365.     tp->ngx_tm_mon = (ngx_tm_mon_t) mon;
  366.     tp->ngx_tm_year = (ngx_tm_year_t) year;
  367.     tp->ngx_tm_wday = (ngx_tm_wday_t) wday;
           ^
  368. }
  369. 

src/core/ngx_times.c:55:1: <Length trace>
53. 
54. 
55. static char  *week[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
    ^
56. static char  *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
57.                            "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };

src/core/ngx_times.c:55:1: Array declaration
53. 
54. 
55. static char  *week[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
    ^
56. static char  *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
57.                            "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };

src/core/ngx_times.c:119:24: Array access: Offset: [-6, 6] Size: 7
117. 
118.     (void) ngx_sprintf(p0, "%s, %02d %s %4d %02d:%02d:%02d GMT",
119.                        week[gmt.ngx_tm_wday], gmt.ngx_tm_mday,
                            ^
120.                        months[gmt.ngx_tm_mon - 1], gmt.ngx_tm_year,
121.                        gmt.ngx_tm_hour, gmt.ngx_tm_min, gmt.ngx_tm_sec);

void
ngx_time_update(void)
{
    u_char          *p0, *p1, *p2, *p3;
    ngx_tm_t         tm, gmt;
    time_t           sec;
    ngx_uint_t       msec;
    ngx_time_t      *tp;
    struct timeval   tv;
    if (!ngx_trylock(&ngx_time_lock)) {
        return;
    }
    ngx_gettimeofday(&tv);
    sec = tv.tv_sec;
    msec = tv.tv_usec / 1000;
    ngx_current_msec = (ngx_msec_t) sec * 1000 + msec;
    tp = &cached_time[slot];
    if (tp->sec == sec) {
        tp->msec = msec;
        ngx_unlock(&ngx_time_lock);
        return;
    }
    if (slot == NGX_TIME_SLOTS - 1) {
        slot = 0;
    } else {
        slot++;
    }
    tp = &cached_time[slot];
    tp->sec = sec;
    tp->msec = msec;
    ngx_gmtime(sec, &gmt);
    p0 = &cached_http_time[slot][0];
    (void) ngx_sprintf(p0, "%s, %02d %s %4d %02d:%02d:%02d GMT",
                       week[gmt.ngx_tm_wday], gmt.ngx_tm_mday,
                       months[gmt.ngx_tm_mon - 1], gmt.ngx_tm_year,
                       gmt.ngx_tm_hour, gmt.ngx_tm_min, gmt.ngx_tm_sec);
#if (NGX_HAVE_GETTIMEZONE)
    tp->gmtoff = ngx_gettimezone();
    ngx_gmtime(sec + tp->gmtoff * 60, &tm);
#elif (NGX_HAVE_GMTOFF)
    ngx_localtime(sec, &tm);
    cached_gmtoff = (ngx_int_t) (tm.ngx_tm_gmtoff / 60);
    tp->gmtoff = cached_gmtoff;
#else
    ngx_localtime(sec, &tm);
    cached_gmtoff = ngx_timezone(tm.ngx_tm_isdst);
    tp->gmtoff = cached_gmtoff;
#endif
    p1 = &cached_err_log_time[slot][0];
    (void) ngx_sprintf(p1, "%4d/%02d/%02d %02d:%02d:%02d",
                       tm.ngx_tm_year, tm.ngx_tm_mon,
                       tm.ngx_tm_mday, tm.ngx_tm_hour,
                       tm.ngx_tm_min, tm.ngx_tm_sec);
    p2 = &cached_http_log_time[slot][0];
    (void) ngx_sprintf(p2, "%02d/%s/%d:%02d:%02d:%02d %c%02d%02d",
                       tm.ngx_tm_mday, months[tm.ngx_tm_mon - 1],
                       tm.ngx_tm_year, tm.ngx_tm_hour,
                       tm.ngx_tm_min, tm.ngx_tm_sec,
                       tp->gmtoff < 0 ? '-' : '+',
                       ngx_abs(tp->gmtoff / 60), ngx_abs(tp->gmtoff % 60));
    p3 = &cached_http_log_iso8601[slot][0];
    (void) ngx_sprintf(p3, "%4d-%02d-%02dT%02d:%02d:%02d%c%02d:%02d",
                       tm.ngx_tm_year, tm.ngx_tm_mon,
                       tm.ngx_tm_mday, tm.ngx_tm_hour,
                       tm.ngx_tm_min, tm.ngx_tm_sec,
                       tp->gmtoff < 0 ? '-' : '+',
                       ngx_abs(tp->gmtoff / 60), ngx_abs(tp->gmtoff % 60));
    ngx_memory_barrier();
    ngx_cached_time = tp;
    ngx_cached_http_time.data = p0;
    ngx_cached_err_log_time.data = p1;
    ngx_cached_http_log_time.data = p2;
    ngx_cached_http_log_iso8601.data = p3;
    ngx_unlock(&ngx_time_lock);
}
['void\nngx_time_update(void)\n{\n    u_char          *p0, *p1, *p2, *p3;\n    ngx_tm_t         tm, gmt;\n    time_t           sec;\n    ngx_uint_t       msec;\n    ngx_time_t      *tp;\n    struct timeval   tv;\n    if (!ngx_trylock(&ngx_time_lock)) {\n        return;\n    }\n    ngx_gettimeofday(&tv);\n    sec = tv.tv_sec;\n    msec = tv.tv_usec / 1000;\n    ngx_current_msec = (ngx_msec_t) sec * 1000 + msec;\n    tp = &cached_time[slot];\n    if (tp->sec == sec) {\n        tp->msec = msec;\n        ngx_unlock(&ngx_time_lock);\n        return;\n    }\n    if (slot == NGX_TIME_SLOTS - 1) {\n        slot = 0;\n    } else {\n        slot++;\n    }\n    tp = &cached_time[slot];\n    tp->sec = sec;\n    tp->msec = msec;\n    ngx_gmtime(sec, &gmt);\n    p0 = &cached_http_time[slot][0];\n    (void) ngx_sprintf(p0, "%s, %02d %s %4d %02d:%02d:%02d GMT",\n                       week[gmt.ngx_tm_wday], gmt.ngx_tm_mday,\n                       months[gmt.ngx_tm_mon - 1], gmt.ngx_tm_year,\n                       gmt.ngx_tm_hour, gmt.ngx_tm_min, gmt.ngx_tm_sec);\n#if (NGX_HAVE_GETTIMEZONE)\n    tp->gmtoff = ngx_gettimezone();\n    ngx_gmtime(sec + tp->gmtoff * 60, &tm);\n#elif (NGX_HAVE_GMTOFF)\n    ngx_localtime(sec, &tm);\n    cached_gmtoff = (ngx_int_t) (tm.ngx_tm_gmtoff / 60);\n    tp->gmtoff = cached_gmtoff;\n#else\n    ngx_localtime(sec, &tm);\n    cached_gmtoff = ngx_timezone(tm.ngx_tm_isdst);\n    tp->gmtoff = cached_gmtoff;\n#endif\n    p1 = &cached_err_log_time[slot][0];\n    (void) ngx_sprintf(p1, "%4d/%02d/%02d %02d:%02d:%02d",\n                       tm.ngx_tm_year, tm.ngx_tm_mon,\n                       tm.ngx_tm_mday, tm.ngx_tm_hour,\n                       tm.ngx_tm_min, tm.ngx_tm_sec);\n    p2 = &cached_http_log_time[slot][0];\n    (void) ngx_sprintf(p2, "%02d/%s/%d:%02d:%02d:%02d %c%02d%02d",\n                       tm.ngx_tm_mday, months[tm.ngx_tm_mon - 1],\n                       tm.ngx_tm_year, tm.ngx_tm_hour,\n                       tm.ngx_tm_min, tm.ngx_tm_sec,\n                       tp->gmtoff < 0 ? \'-\' : \'+\',\n                       ngx_abs(tp->gmtoff / 60), ngx_abs(tp->gmtoff % 60));\n    p3 = &cached_http_log_iso8601[slot][0];\n    (void) ngx_sprintf(p3, "%4d-%02d-%02dT%02d:%02d:%02d%c%02d:%02d",\n                       tm.ngx_tm_year, tm.ngx_tm_mon,\n                       tm.ngx_tm_mday, tm.ngx_tm_hour,\n                       tm.ngx_tm_min, tm.ngx_tm_sec,\n                       tp->gmtoff < 0 ? \'-\' : \'+\',\n                       ngx_abs(tp->gmtoff / 60), ngx_abs(tp->gmtoff % 60));\n    ngx_memory_barrier();\n    ngx_cached_time = tp;\n    ngx_cached_http_time.data = p0;\n    ngx_cached_err_log_time.data = p1;\n    ngx_cached_http_log_time.data = p2;\n    ngx_cached_http_log_iso8601.data = p3;\n    ngx_unlock(&ngx_time_lock);\n}', 'void\nngx_gmtime(time_t t, ngx_tm_t *tp)\n{\n    ngx_int_t   yday;\n    ngx_uint_t  n, sec, min, hour, mday, mon, year, wday, days, leap;\n    n = (ngx_uint_t) t;\n    days = n / 86400;\n    wday = (4 + days) % 7;\n    n %= 86400;\n    hour = n / 3600;\n    n %= 3600;\n    min = n / 60;\n    sec = n % 60;\n    days = days - (31 + 28) + 719527;\n    year = (days + 2) * 400 / (365 * 400 + 100 - 4 + 1);\n    yday = days - (365 * year + year / 4 - year / 100 + year / 400);\n    if (yday < 0) {\n        leap = (year % 4 == 0) && (year % 100 || (year % 400 == 0));\n        yday = 365 + leap + yday;\n        year--;\n    }\n    mon = (yday + 31) * 10 / 306;\n    mday = yday - (367 * mon / 12 - 30) + 1;\n    if (yday >= 306) {\n        year++;\n        mon -= 10;\n    } else {\n        mon += 2;\n    }\n    tp->ngx_tm_sec = (ngx_tm_sec_t) sec;\n    tp->ngx_tm_min = (ngx_tm_min_t) min;\n    tp->ngx_tm_hour = (ngx_tm_hour_t) hour;\n    tp->ngx_tm_mday = (ngx_tm_mday_t) mday;\n    tp->ngx_tm_mon = (ngx_tm_mon_t) mon;\n    tp->ngx_tm_year = (ngx_tm_year_t) year;\n    tp->ngx_tm_wday = (ngx_tm_wday_t) wday;\n}']