* src/init.c (cmd_bytes_sum): Fix integer over- and underflow

This commit is contained in:
Tim Rühsen 2018-04-15 22:04:16 +02:00
parent 15ef79f808
commit e0860dd1ff

View File

@ -1342,7 +1342,9 @@ static bool
cmd_bytes_sum (const char *com, const char *val, void *place)
{
double byte_value;
if (!parse_bytes_helper (val, &byte_value))
if (!parse_bytes_helper (val, &byte_value)
|| byte_value < LONG_MIN || byte_value > LONG_MAX)
{
fprintf (stderr, _("%s: %s: Invalid byte value %s\n"),
exec_name, com, quote (val));