From 404600ebb4d417238bfabf7ec1561a62dc83c168 Mon Sep 17 00:00:00 2001
From: grajagandev <dmoorefo@gmail.com>
Date: Mon, 8 Feb 2016 07:58:45 -0800
Subject: [PATCH 04/15] Fix signed integer overflow - big block sizes

---
 src/main.c         | 2 +-
 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;
-- 
1.8.3.1

