From b592ec5b1f6bae9d32b1d49f7f33b3cbb2b99854 Mon Sep 17 00:00:00 2001 From: Oliver Hartkopp Date: Wed, 7 Aug 2024 13:02:05 +0200 Subject: [PATCH] canbusload: fix string length check for CAN FD The CAN interface description can now have two bitrates. Extend the length check to handle the CAN FD data bitrate correctly. Fixes: 6382765bf6ae ("canbusload: count databitrate seperately") Signed-off-by: Oliver Hartkopp --- canbusload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canbusload.c b/canbusload.c index d2906ae..d7165da 100644 --- a/canbusload.c +++ b/canbusload.c @@ -309,7 +309,7 @@ int main(int argc, char **argv) ptr = argv[optind + i]; nbytes = strlen(ptr); - if (nbytes >= (int)(IFNAMSIZ + sizeof("@1000000") + 1)) { + if (nbytes >= (int)(IFNAMSIZ + sizeof("@1000000,2000000") + 1)) { printf("name of CAN device '%s' is too long!\n", ptr); return 1; }