Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 447c233d authored by Roel Kluin's avatar Roel Kluin Committed by Helge Deller
Browse files

parisc: Fix read buffer overflow in pdc_stable driver



Check whether index is within bounds before testing the element.

Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent b4f2e2ad
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -370,7 +370,7 @@ pdcspath_layer_read(struct pdcspath_entry *entry, char *buf)
	if (!i)	/* entry is not ready */
		return -ENODATA;
	
	for (i = 0; devpath->layers[i] && (likely(i < 6)); i++)
	for (i = 0; i < 6 && devpath->layers[i]; i++)
		out += sprintf(out, "%u ", devpath->layers[i]);

	out += sprintf(out, "\n");