Browse code

fix possible out of bounds stack read.

Steven Morgan authored on 2016/07/13 03:31:38
Showing 1 changed files
... ...
@@ -469,7 +469,8 @@ static int read_tables(int fd, unpack_data_t *unpack_data)
469 469
 				rar_addbits(unpack_data, 7);
470 470
 			}
471 471
 			while (n-- > 0 && i < table_size) {
472
-				table[i] = table[i-1];
472
+				if (i>0)
473
+					table[i] = table[i-1];
473 474
 				i++;
474 475
 			}
475 476
 		} else {