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

[MiNT] [PATCH] Fix XHInqDriver( ) XHDI function in USB storage



Commit message:

Fix XHInqDriver( ) XHDI function.
Contributed by David Gálvez
diff -r 02bd71aa9747 -r 03b21c91c13e sys/usb/src.km/udd/storage/xhdi.c
--- a/sys/usb/src.km/udd/storage/xhdi.c	Sun Apr 26 11:36:13 2015 +0200
+++ b/sys/usb/src.km/udd/storage/xhdi.c	Tue May 05 21:14:31 2015 +0200
@@ -41,6 +41,9 @@
 #define MAX_IPL			5
 #define XH_TARGET_REMOVABLE	0x02L
 #define STRINGLEN		33 /* including termination character */
+#define DRIVER_NAME_MAXLEN		17
+#define DRIVER_VERSION_MAXLEN	7
+#define DRIVER_COMPANY_MAXLEN	17
 
 #ifdef TOSONLY
 char *DRIVER_NAME = "TOS USB";
@@ -394,11 +397,11 @@
 		return ENODEV;
 
 	if(name)
-		name = DRIVER_NAME;
+		strncpy(name, DRIVER_NAME, DRIVER_NAME_MAXLEN);
 	if(version)
-		version = drv_version;
+		strncpy(version, drv_version, DRIVER_VERSION_MAXLEN);
 	if(company)
-		company = DRIVER_COMPANY;
+		strncpy(company, DRIVER_COMPANY, DRIVER_COMPANY_MAXLEN);
 	if(ahdi_version)
 		*ahdi_version = pun_usb.version_num;
 	if(max_IPL)