From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ddf1R-0008Bc-Ki for barebox@lists.infradead.org; Fri, 04 Aug 2017 16:00:24 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Fri, 4 Aug 2017 17:59:56 +0200 Message-Id: <20170804155956.19105-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH] scripts/imx: fix out-of-bounds access for big DCD tables To: barebox@lists.infradead.org YWRkX2hlYWRlcl92MiBtaWdodCBuZWVkIGEgYnVmZmVyIHRoYXQgaXMgYmlnZ2VyIHRoYW4gSEVB REVSX0xFTgooMHgxMDAwKSBhcyBNQVhfRENEICogc2l6ZW9mKHUzMikgKGkuZS4gdGhlIG1heGlt YWwgc2l6ZSBvZiB0aGUgZGNkCnRhYmxlIGFsb25lKSBpcyBhbHJlYWR5IDB4MTAwMC4gQWRkaXRp b25hbGx5IGFkZF9oZWFkZXJfdjIgYWRkcyBwYWRkaW5nCih1c3VhbGx5IDB4NDAwKSBhbmQgYSBz dHJ1Y3QgaW14X2ZsYXNoX2hlYWRlcl92MiAoNDgpLiBTbyBleHBhbmQgdGhlCmJ1ZmZlciBzaXpl IGFjY29yZGluZ2x5IGZvciB2Mi4KClNpZ25lZC1vZmYtYnk6IFV3ZSBLbGVpbmUtS8O2bmlnIDx1 LmtsZWluZS1rb2VuaWdAcGVuZ3V0cm9uaXguZGU+Ci0tLQogc2NyaXB0cy9pbXgvaW14LWltYWdl LmMgfCAxMiArKysrKysrKy0tLS0KIDEgZmlsZSBjaGFuZ2VkLCA4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