Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102783317
D35233.id106096.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
958 B
Referenced Files
None
Subscribers
None
D35233.id106096.diff
View Options
Index: sys/dev/hid/hidraw.c
===================================================================
--- sys/dev/hid/hidraw.c
+++ sys/dev/hid/hidraw.c
@@ -569,6 +569,7 @@
struct hidraw_gen_descriptor *hgd;
struct hidraw_report_descriptor *hrd;
struct hidraw_devinfo *hdi;
+ const char *devname;
uint32_t size;
int id, len;
int error = 0;
@@ -825,10 +826,13 @@
switch (IOCBASECMD(cmd)) {
case HIDIOCGRAWNAME(0):
strlcpy(addr, sc->sc_hw->name, len);
+ td->td_retval[0] = min(strlen(sc->sc_hw->name), len);
return (0);
case HIDIOCGRAWPHYS(0):
- strlcpy(addr, device_get_nameunit(sc->sc_dev), len);
+ devname = device_get_nameunit(sc->sc_dev);
+ strlcpy(addr, devname, len);
+ td->td_retval[0] = min(strlen(devname), len);
return (0);
case HIDIOCSFEATURE(0):
@@ -859,6 +863,7 @@
case HIDIOCGRAWUNIQ(0):
strlcpy(addr, sc->sc_hw->serial, len);
+ td->td_retval[0] = min(strlen(sc->sc_hw->serial), len);
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 3:28 AM (22 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14689085
Default Alt Text
D35233.id106096.diff (958 B)
Attached To
Mode
D35233: hidraw: Return string lengths for certain ioctls
Attached
Detach File
Event Timeline
Log In to Comment