mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
od: fix another off-by-one issue with --strings
* src/od.c (main): Fix off-by-one error in string_min limit.
This commit is contained in:
1 parent
0d1c25d1cb
commit
69b07cc58d
1 file changed
+3
-3
@@ -1738,10 +1738,10 @@ main (int argc, char **argv)
|
||||
if (s_err != LONGINT_OK)
|
||||
xstrtol_fatal (s_err, oi, c, long_options, optarg);
|
||||
|
||||
/* The minimum string length may be no larger than
|
||||
/* The minimum string length must be less than
|
||||
MIN (IDX_MAX, SIZE_MAX), since we may allocate a
|
||||
buffer of this size. */
|
||||
if (MIN (IDX_MAX, SIZE_MAX) < tmp)
|
||||
buffer of this size + 1. */
|
||||
if (MIN (IDX_MAX, SIZE_MAX) <= tmp)
|
||||
error (EXIT_FAILURE, 0, _("%s is too large"), quote (optarg));
|
||||
|
||||
string_min = tmp;
|
||||
|
||||
Reference in new issue
Block a user