lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:	Thu, 17 Apr 2008 19:56:13 +0200
From:	Roel Kluin <12o3l@...cali.nl>
To:	dbrownell@...rs.sourceforge.net
CC:	linux-usb@...r.kernel.org, lkml <linux-kernel@...r.kernel.org>
Subject: [PATCH] ehci-dbg: evaluate negative snprintf() retvals in qh_lines()

Only when signed, a snprintf() retval below zero can be evaluated.

Signed-off-by: Roel Kluin <12o3l@...cali.nl>
---
diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c
index 64ebfc5..25a98c1 100644
--- a/drivers/usb/host/ehci-dbg.c
+++ b/drivers/usb/host/ehci-dbg.c
@@ -394,7 +394,7 @@ static void qh_lines (
 	u32			hw_curr;
 	struct list_head	*entry;
 	struct ehci_qtd		*td;
-	unsigned		temp;
+	int			temp;
 	unsigned		size = *sizep;
 	char			*next = *nextp;
 	char			mark;
@@ -459,9 +459,9 @@ static void qh_lines (
 		else if (size < temp)
 			temp = size;
 		size -= temp;
-		next += temp;
 		if (temp == size)
 			goto done;
+		next += temp;
 	}
 
 	temp = snprintf (next, size, "\n");
@@ -470,11 +470,10 @@ static void qh_lines (
 	else if (size < temp)
 		temp = size;
 	size -= temp;
-	next += temp;
 
 done:
 	*sizep = size;
-	*nextp = next;
+	*nextp = next + temp;
 }
 
 static ssize_t fill_async_buffer(struct debug_buffer *buf)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ