From patchwork Mon Feb 29 14:51: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: 63224 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1293948lbc; Mon, 29 Feb 2016 06:52:11 -0800 (PST) X-Received: by 10.66.218.225 with SMTP id pj1mr21986595pac.83.1456757531203; Mon, 29 Feb 2016 06:52:11 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id vg13si23112206pab.48.2016.02.29.06.52.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Feb 2016 06:52:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 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 1AF2A1A1E1E; Mon, 29 Feb 2016 06:52:18 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-pf0-x230.google.com (mail-pf0-x230.google.com [IPv6:2607:f8b0:400e:c00::230]) (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 6EA051A1E19 for ; Mon, 29 Feb 2016 06:52:17 -0800 (PST) Received: by mail-pf0-x230.google.com with SMTP id 4so15304120pfd.1 for ; Mon, 29 Feb 2016 06:52:10 -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:in-reply-to:references :mime-version; bh=SzICnnJcVTMUGDyd375jf011IXJ7YCUUyIc8uGb/KSA=; b=Irglz8zd7s0w51d66t4pjYpHnzIXDgBCt4nQ3Pa3wXxlR9ONziZuM/j+FY8DrwT/Gg aeDpH8v5AwMhjMQfGC+KbCgjraVRiZm1fuzWrRjJxwtznkBIET42WnF8wXeWWS2gqVdt S0QYlOm1Hq+GHWahcX/C9t/cOqq+/t39RRzys= 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:in-reply-to :references:mime-version; bh=SzICnnJcVTMUGDyd375jf011IXJ7YCUUyIc8uGb/KSA=; b=ZTCVNJCVGFnxUZREh1tVWAs/9quFzXCsjv1LWjFkWkSuB6kp8qMP7QO2p6iLQgY57A b1U5S1j4NcPF5ktKYQ2eUUiMUWBZFacVw/y8BapVg24l/PxjKEaD/STlYKpiGhm2C8+E vPvfJVSTQpKBU7YA7wXRugUDFP2zvzKB8ZfZ8kvj+w1YGxH77zBsmmy2pmHcL1lL+u0/ BoLCTcu1kfZiyyZUBTqK83iw83KDUAhi7Tvx5p3D2pKNjRfl+279qgdDcQ7i4ltG7mFd zH6sQf+bLaVJ/Z9nWeBO4gAZutWrVk2LoIIMtu80OPYfj6oIOc0zVZ/hXUbdOES6hvOS QtOw== X-Gm-Message-State: AD7BkJKhizj0TNltBgNaEnd2NYpcs7QhmIPeJU+NTiGjCrNHaO22ksVP6VCDW8DuaB4q8VNf X-Received: by 10.98.8.196 with SMTP id 65mr14059997pfi.53.1456757529878; Mon, 29 Feb 2016 06:52:09 -0800 (PST) Received: from mail.hotmail.com (blu004-wss1s3.hotmail.com. [134.170.2.218]) by smtp.gmail.com with ESMTPSA id fl9sm38793295pab.30.2016.02.29.06.52.07 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Feb 2016 06:52:08 -0800 (PST) Received: from BLU436-SMTP183 ([134.170.2.215]) by BLU004-WSS1S3.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Mon, 29 Feb 2016 06:52:06 -0800 X-TMN: [pciI7UQvbiKgTKaTuqwxayEVvkvSwHlP] Message-ID: From: Haojian Zhuang To: edk2-devel@lists.01.org, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org Date: Mon, 29 Feb 2016 22:51:50 +0800 X-Mailer: git-send-email 1.9.1 In-Reply-To: <1456757510-821-1-git-send-email-haojian.zhuang@linaro.org> References: <1456757510-821-1-git-send-email-haojian.zhuang@linaro.org> X-OriginalArrivalTime: 29 Feb 2016 14:52:03.0343 (UTC) FILETIME=[C04581F0:01D17300] MIME-Version: 1.0 Cc: Zhangfei Gao , Haojian Zhuang Subject: [edk2] [PATCH v2 1/1] 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 Reviewed-by: Leif Lindholm diff --git a/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c b/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c index f380817..9ddc34f 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 UINT64 mNumDataBytes; // .. and the number of bytes so far received this data phase -STATIC UINT32 mBytesReceivedSoFar; +STATIC UINT64 mBytesReceivedSoFar; // .. and the buffer to save data into STATIC UINT8 *mDataBuffer = NULL;