diff options
author | Nikias Bassen | 2018-10-12 14:26:01 +0200 |
---|---|---|
committer | Nikias Bassen | 2018-10-12 14:26:01 +0200 |
commit | 1cc8b343a4bc9320758c78e187b13bb3c9029f12 (patch) | |
tree | 9471ec444ef3ad12dc9221a5ba1d536513f88db2 | |
parent | f838cf6dc212c779562984e8a16a4cedfc1d6daf (diff) | |
download | usbmuxd-1cc8b343a4bc9320758c78e187b13bb3c9029f12.tar.gz usbmuxd-1cc8b343a4bc9320758c78e187b13bb3c9029f12.tar.bz2 |
usb: Fix adding hyphen to new style UDIDs by not counting '\0' towards string length
-rw-r--r-- | src/usb.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -274,6 +274,8 @@ static void get_serial_callback(struct libusb_transfer *transfer) for (di = 0, si = 2; si < data[0] && di < sizeof(usbdev->serial)-1; si += 2) { if ((data[si] & 0x80) || (data[si + 1])) /* non-ASCII */ usbdev->serial[di++] = '?'; + else if (data[si] == '\0') + break; else usbdev->serial[di++] = data[si]; } |