Browse code

Revert "bb11281 - crash in upack.c identified and changes suggested by Sebastian Andrzej Siewior."

This reverts commit fd738c77c98fe8a214a1382ceef19b913a425f90.

Steven Morgan authored on 2015/03/18 07:25:27
Showing 1 changed files
... ...
@@ -302,7 +302,7 @@ int unupack(int upack, char *dest, uint32_t dsize, char *buff, uint32_t vma, uin
302 302
 			loc_esi += 4;
303 303
 			cli_dbgmsg("Upack: ecx counter: %08x\n", j);
304 304
 
305
-			if (!CLI_ISCONTAINED(dest, (dsize/4), loc_esi, j) || !CLI_ISCONTAINED(dest, (dsize/4), loc_edi, (j+count)))
305
+			if (!CLI_ISCONTAINED(dest, dsize, loc_esi, (j*4)) || !CLI_ISCONTAINED(dest, dsize, loc_edi, ((j+count)*4)))
306 306
 				return -1;
307 307
 			for (;j--; loc_edi+=4, loc_esi+=4)
308 308
 				cli_writeint32(loc_edi, cli_readint32(loc_esi));
... ...
@@ -359,7 +359,7 @@ int unupack(int upack, char *dest, uint32_t dsize, char *buff, uint32_t vma, uin
359 359
 			loc_edi += 4;
360 360
 			loc_ebx = loc_edi;
361 361
 		
362
-			if (!CLI_ISCONTAINED(dest, (dsize/4), loc_edi, (6+count)))
362
+			if (!CLI_ISCONTAINED(dest, dsize, loc_edi, ((6+count)*4)))
363 363
 				return -1;
364 364
 			cli_writeint32(loc_edi, 0xffffffff);
365 365
 			loc_edi += 4;