* src/ls.c (align_nstrftime): Be defensive and validate the tm_mon
index before using to access the abmon array. This was _not_ seen
to be an issue any system. See https://bugzilla.redhat.com/
1190454
the replacement is not done. A malloc here slows ls down by 2% */
char rpl_fmt[sizeof (abmon[0]) + 100];
const char *pb;
- if (required_mon_width && (pb = strstr (fmt, "%b")))
+ if (required_mon_width && (pb = strstr (fmt, "%b"))
+ && 0 <= tm->tm_mon && tm->tm_mon <= 11)
{
if (strlen (fmt) < (sizeof (rpl_fmt) - sizeof (abmon[0]) + 2))
{