We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9d4f3c8 commit 9e44407Copy full SHA for 9e44407
1 file changed
canerrsim.c
@@ -538,6 +538,9 @@ int main(int argc, char *argv[])
538
err_exit("Error while opening socket\n");
539
540
// set interface name
541
+ if (strlen(argv[1]) >= IFNAMSIZ)
542
+ err_exit("Name of CAN device '%s' is too long!\n\n", argv[1]);
543
+
544
strcpy(ifr.ifr_name, argv[1]); // can0, vcan0...
545
if (ioctl(sock, SIOCGIFINDEX, &ifr) < 0)
546
err_exit("Error setting CAN interface name %s\n", argv[1]);
0 commit comments