Fix possible buffer overflow (thanks Rigan) nikias
authorNikias Bassen <nikias@gmx.li>
Thu, 12 Jan 2012 02:03:29 +0000 (03:03 +0100)
committerNikias Bassen <nikias@gmx.li>
Thu, 12 Jan 2012 02:03:29 +0000 (03:03 +0100)
libusbmuxd/libusbmuxd.c

index e06ee61..98e92df 100644 (file)
@@ -189,7 +189,7 @@ static int receive_packet(int sfd, struct usbmuxd_header *header, void **payload
                                char *strval = NULL;
                                plist_get_string_val(n, &strval);
                                if (strval) {
-                                       strcpy(dev->serial_number, strval);
+                                       strncpy(dev->serial_number, strval, 255);
                                        free(strval);
                                }
                                n = plist_dict_get_item(props, "LocationID");