Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kZWnd-0005D2-4P for mharc-qemu-trivial@gnu.org; Mon, 02 Nov 2020 05:10:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZWnb-00059o-GP; Mon, 02 Nov 2020 05:10:51 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:2066) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZWnY-00069t-BM; Mon, 02 Nov 2020 05:10:50 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4CPpZn4jQ1zhZ39; Mon, 2 Nov 2020 18:10:41 +0800 (CST) Received: from [10.174.187.138] (10.174.187.138) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Mon, 2 Nov 2020 18:10:34 +0800 Message-ID: <5F9FDB1A.4010700@huawei.com> Date: Mon, 2 Nov 2020 18:10:34 +0800 From: AlexChen User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= CC: Peter Maydell , QEMU Trivial , qemu-arm , QEMU , Subject: Re: [PATCH V2] hw/display/exynos4210_fimd: Fix potential NULL pointer dereference References: <5F9F8D88.9030102@huawei.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.187.138] X-CFilter-Loop: Reflected Received-SPF: pass client-ip=45.249.212.32; envelope-from=alex.chen@huawei.com; helo=szxga06-in.huawei.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/02 05:10:42 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-trivial@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Nov 2020 10:10:52 -0000 On 2020/11/2 17:16, Philippe Mathieu-Daudé wrote: > On 11/2/20 5:39 AM, AlexChen wrote: >> In exynos4210_fimd_update(), the pointer s is dereferinced before > > Typo dereferinced -> dereferenced. > >> being check if it is valid, which may lead to NULL pointer dereference. >> So move the assignment to global_width after checking that the s is valid. > > Easier to read "after checking 's' is valid." > >> >> Reported-by: Euler Robot >> Signed-off-by: Alex Chen >> --- >> hw/display/exynos4210_fimd.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) > > Reviewed-by: Philippe Mathieu-Daudé > Thanks for your review, I will fix it in my patch V3. Thanks, Alex