Skip to content

Commit 5660e68

Browse files
committed
udev-builtin-net_id: fix potential buffer overflow
1 parent a1008b2 commit 5660e68

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/udev/udev-builtin-net_id.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,11 +948,11 @@ static int names_usb(sd_device *dev, NetNames *names) {
948948

949949
/* append USB config number, suppress the common config == 1 */
950950
if (!streq(config, "1"))
951-
l = strpcpyl(&s, sizeof(names->usb_ports), "c", config, NULL);
951+
l = strpcpyl(&s, l, "c", config, NULL);
952952

953953
/* append USB interface number, suppress the interface == 0 */
954954
if (!streq(interf, "0"))
955-
l = strpcpyl(&s, sizeof(names->usb_ports), "i", interf, NULL);
955+
l = strpcpyl(&s, l, "i", interf, NULL);
956956
if (l == 0)
957957
return log_device_debug_errno(dev, SYNTHETIC_ERRNO(ENAMETOOLONG),
958958
"Generated USB name would be too long.");

0 commit comments

Comments
 (0)