aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgrajagandev <dmoorefo@gmail.com>2016-02-08 07:58:45 -0800
committerSergey Poznyakoff <gray@gnu.org.ua>2016-11-10 12:56:35 +0200
commit404600ebb4d417238bfabf7ec1561a62dc83c168 (patch)
treeac945f4093462533e44a5eb67d1f38690db9964e /src
parent01a4e056e6a581f015fed3eeaef012f8b951bd89 (diff)
downloadcpio-404600ebb4d417238bfabf7ec1561a62dc83c168.tar.gz
cpio-404600ebb4d417238bfabf7ec1561a62dc83c168.tar.bz2
Fix signed integer overflow - big block sizes
Diffstat (limited to 'src')
-rw-r--r--src/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index a13861f..5a30a7b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -321,7 +321,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
case BLOCK_SIZE_OPTION: /* --block-size */
io_block_size = atoi (arg);
- if (io_block_size < 1)
+ if (io_block_size < 1 || io_block_size > INT_MAX/512)
USAGE_ERROR ((0, 0, _("invalid block size")));
io_block_size *= 512;
break;

Return to:

Send suggestions and report system problems to the System administrator.