EmbeddedPkg/AndroidFastboot: fix size with 64bit
authorHaojian Zhuang <haojian.zhuang@linaro.org>
Mon, 29 Feb 2016 14:51:50 +0000 (22:51 +0800)
committerLeif Lindholm <leif.lindholm@linaro.org>
Mon, 29 Feb 2016 15:27:13 +0000 (15:27 +0000)
Since there's percentage calcution, multiply on 32bit variable
will cause overflow. So fix the variables as 64bit.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c

index f380817..9ddc34f 100644 (file)
@@ -45,9 +45,9 @@ typedef enum {
 STATIC ANDROID_FASTBOOT_STATE mState = ExpectCmdState;\r
 \r
 // When in ExpectDataState, the number of bytes of data to expect:\r
-STATIC UINT32 mNumDataBytes;\r
+STATIC UINT64 mNumDataBytes;\r
 // .. and the number of bytes so far received this data phase\r
-STATIC UINT32 mBytesReceivedSoFar;\r
+STATIC UINT64 mBytesReceivedSoFar;\r
 // .. and the buffer to save data into\r
 STATIC UINT8 *mDataBuffer = NULL;\r
 \r