* lib/human.c (human_readable): Fix off-by-one typo in buffer
calculation that could lead to a one-byte buffer overrun.
+2015-12-31 Paul Eggert <eggert@cs.ucla.edu>
+
+ human: fix output buffer overrun by 1
+ * lib/human.c (human_readable): Fix off-by-one typo in buffer
+ calculation that could lead to a one-byte buffer overrun.
+
2015-12-28 Daiki Ueno <ueno@gnu.org>
maint: fix operator precedence in mbrtowc test
if (strlen (l->thousands_sep) <= MB_LEN_MAX)
thousands_sep = l->thousands_sep;
- psuffix = buf + LONGEST_HUMAN_READABLE - HUMAN_READABLE_SUFFIX_LENGTH_MAX;
+ /* Leave room for a trailing space and following suffix. */
+ psuffix = buf + LONGEST_HUMAN_READABLE - 1 - HUMAN_READABLE_SUFFIX_LENGTH_MAX;
p = psuffix;
/* Adjust AMT out of FROM_BLOCK_SIZE units and into TO_BLOCK_SIZE