Page MenuHomeFreeBSD

D35233.id106096.diff
No OneTemporary

D35233.id106096.diff

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

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)

Event Timeline