From patchwork Fri Feb 26 09:34:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 62993 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp610843lbc; Fri, 26 Feb 2016 01:35:04 -0800 (PST) X-Received: by 10.98.11.88 with SMTP id t85mr702541pfi.98.1456479303580; Fri, 26 Feb 2016 01:35:03 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id yp9si18782399pab.121.2016.02.26.01.35.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Feb 2016 01:35:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D52281A1E0F; Fri, 26 Feb 2016 01:35:07 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-pf0-x22a.google.com (mail-pf0-x22a.google.com [IPv6:2607:f8b0:400e:c00::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6AD811A1E0D for ; Fri, 26 Feb 2016 01:35:07 -0800 (PST) Received: by mail-pf0-x22a.google.com with SMTP id w128so1747527pfb.2 for ; Fri, 26 Feb 2016 01:35:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:from:to:cc:subject:date:mime-version; bh=EyL85E9WQkTF9Bkt7Wj1/8Kk2yEENwPi6jlkFz2GYDw=; b=Db+lb1bpGPh8iqkx2zYTEvT7/FPKqXDplGnLQe21oGss9O2Hpc9k/seEJj9ZeQ7SnV cqX/7DYIiQ/G6UaBesWZE9IuvXIzVDjHjxA2zUpXSkRt10r0APFOcVZtrD5Y98lYSc1H hNNBH/qcxO4cADErH+XKbfkA4N0f1YBmxAkKg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:from:to:cc:subject:date:mime-version; bh=EyL85E9WQkTF9Bkt7Wj1/8Kk2yEENwPi6jlkFz2GYDw=; b=iomRzBAai6p1CxIgVArorTY0BaG03m1+Gcc7NvEtyB7+s3CaUdBPjLmdMX1TpOiY6V PQ/9xuqqaRaIGYs6qer4O8Oz5TSoB4L46xkChYl5U5rt1qNKaGLWHROqKOs7UDu5BJWg Hfz5rH3I91hfko6WujzBcH2+VESSoUSM604xvXCAx6lzxQ/jlkP5FeQRsfaBghetg/R9 7q/iE2INIJX6R0vFhAf/jx0vNPIjlvwTLscnPo3b/OwSYrddRKycgsD2rIhPTSu4b2eb IyFaY49lxp8DTzQEP1exop3qoBlF9VexfSGqxQuybUEuhYmzdQmvHX98HzQ3LhpJfK3s Uhwg== X-Gm-Message-State: AD7BkJJMKvtWr6puw2OunZvtb+8QHLF9/u/nPY4wh/KSkIQt9PSjuKA3I7MmRQq+ZSuK3HbM X-Received: by 10.98.69.155 with SMTP id n27mr696724pfi.68.1456479302298; Fri, 26 Feb 2016 01:35:02 -0800 (PST) Received: from mail.hotmail.com (blu004-wss1s6.hotmail.com. [134.170.2.221]) by smtp.gmail.com with ESMTPSA id r77sm17890533pfa.47.2016.02.26.01.35.00 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Feb 2016 01:35:01 -0800 (PST) Received: from BLU436-SMTP202 ([134.170.2.215]) by BLU004-WSS1S6.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Fri, 26 Feb 2016 01:34:59 -0800 X-TMN: [num/o+VmU1X06VLwl6XX4gAXHG1fptmt] Message-ID: From: Haojian Zhuang To: edk2-devel@lists.01.org, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org Date: Fri, 26 Feb 2016 17:34:50 +0800 X-Mailer: git-send-email 1.9.1 X-OriginalArrivalTime: 26 Feb 2016 09:34:57.0682 (UTC) FILETIME=[F4DAC720:01D17078] MIME-Version: 1.0 Cc: Zhangfei Gao , Haojian Zhuang Subject: [edk2] [PATCH] EmbeddedPkg/AndroidFastboot: fix size with 64bit X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 1.9.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c b/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c index f380817..91de365 100644 --- a/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c +++ b/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c @@ -45,9 +45,9 @@ typedef enum { STATIC ANDROID_FASTBOOT_STATE mState = ExpectCmdState; // When in ExpectDataState, the number of bytes of data to expect: -STATIC UINT32 mNumDataBytes; +STATIC UINTN mNumDataBytes; // .. and the number of bytes so far received this data phase -STATIC UINT32 mBytesReceivedSoFar; +STATIC UINTN mBytesReceivedSoFar; // .. and the buffer to save data into STATIC UINT8 *mDataBuffer = NULL;