bin/52685: variable used uninitialized in usbhidctl

Alexander Nedotsukov bland at mail.ru
Sun May 25 20:10:14 PDT 2003


>Number:         52685
>Category:       bin
>Synopsis:       variable used uninitialized in usbhidctl
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 25 20:10:09 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Alexander Nedotsukov
>Release:        FreeBSD 5.1-BETA i386
>Organization:
>Environment:
System: FreeBSD bbnest.dyndns.org 5.1-BETA FreeBSD 5.1-BETA #5: Sat May 10 21:37:53 JST 2003 bland at bbnest.dyndns.org:/usr/obj/usr/src/sys/SU i386


	
>Description:
Local variable report_id is never initialized before use. See dumpdata() function.
	
>How-To-Repeat:
	
>Fix:
Apply the patch attached.
	

--- usbhid.c.diff begins here ---
--- usr.bin/usbhidctl/usbhid.c.orig	Mon May 26 11:42:36 2003
+++ usr.bin/usbhidctl/usbhid.c	Mon May 26 11:45:07 2003
@@ -201,7 +201,6 @@
 	static int one = 1;
 	u_int32_t colls[100];
 	int sp = 0;
-	int report_id;
 	char namebuf[10000], *namep;
 
 	hids = 0;
@@ -245,7 +244,7 @@
 			if (all || gotname(namebuf)) {
 				if (!noname)
 					printf("%s=", namebuf);
-				prdata(dbuf + (report_id != 0), n);
+				prdata(dbuf + (reportid != 0), n);
 				printf("\n");
 			}
 		}
--- usbhid.c.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list