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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <46DD1661.4070500@gmail.com>
Date:	Tue, 04 Sep 2007 16:25:05 +0800
From:	Micah Gruber <micah.gruber@...il.com>
To:	linux-kernel@...r.kernel.org,
	linux-usb-devel@...ts.sourceforge.net, gregkh@...e.de
Subject: [PATCH] Fix a potential NULL pointer dereference in usbat_check_status()
 in drivers/usb/storage/shuttle_usbat.c

This patch fixes a potential null dereference bug where we dereference us before a null check. This patch simply moves the dereferencing after the null check.

Signed-off-by: Micah Gruber <micah.gruber@...il.com>
---

--- a/drivers/usb/storage/shuttle_usbat.c
+++ b/drivers/usb/storage/shuttle_usbat.c
@@ -187,12 +187,14 @@
  */
 static int usbat_check_status(struct us_data *us)
 {
-	unsigned char *reply = us->iobuf;
+	unsigned char *reply;
 	int rc;
 
 	if (!us)
 		return USB_STOR_TRANSPORT_ERROR;
 
+	reply = us->iobuf;
+
 	rc = usbat_get_status(us, reply);
 	if (rc != USB_STOR_XFER_GOOD)
 		return USB_STOR_TRANSPORT_FAILED;

-
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