[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] [PATCH][7/7] Check for NULLs in XHInqDriver arguments



HDDRUTIL.APP from HDDRIVER package crashes when calling XHInqDriver( ).

Commit message:

Check for NULL pointers in XHInqDriver arguments.
Contributed by David Galvez.
diff -r 7cc7d02fb296 -r c52d16dc5d5f sys/usb/src.km/udd/storage/xhdi.c
--- a/sys/usb/src.km/udd/storage/xhdi.c	Sun Apr 26 11:02:34 2015 +0200
+++ b/sys/usb/src.km/udd/storage/xhdi.c	Sun Apr 26 11:03:42 2015 +0200
@@ -393,11 +393,16 @@
 	if (pun_usb.pun[dev] & PUN_VALID)
 		return ENODEV;
 
-	name = DRIVER_NAME;
-	version = drv_version;
-	company = DRIVER_COMPANY;
-	*ahdi_version = pun_usb.version_num;
-	*max_IPL = MAX_IPL;
+	if(name)
+		name = DRIVER_NAME;
+	if(version)
+		version = drv_version;
+	if(company)
+		company = DRIVER_COMPANY;
+	if(ahdi_version)
+		*ahdi_version = pun_usb.version_num;
+	if(max_IPL)
+		*max_IPL = MAX_IPL;
 
 	return E_OK;
 }