Browse code

bb11600 - fix out of bounds stack read.

Steven Morgan authored on 2016/07/13 01:36:29
Showing 1 changed files
... ...
@@ -117,7 +117,8 @@ static int read_tables20(int fd, unpack_data_t *unpack_data)
117 117
 			n = (rar_getbits(unpack_data) >> 14) + 3;
118 118
 			rar_addbits(unpack_data, 2);
119 119
 			while ((n-- > 0) && (i < table_size)) {
120
-				table[i] = table[i-1];
120
+				if (i>0)
121
+					table[i] = table[i-1];
121 122
 				i++;
122 123
 			}
123 124
 		} else {