From ed5b495da68f049856360d4072d10ff5ad8b965a Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Mon, 14 Jan 2019 09:13:17 +0100 Subject: [PATCH] testj1939: fail if we use unsupported size Currently if we set size which is more then 128 byte will silently ignore provided value and send only maximal supported size. Signed-off-by: Oleksij Rempel --- testj1939.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testj1939.c b/testj1939.c index 91ec0ba..d93c6ef 100644 --- a/testj1939.c +++ b/testj1939.c @@ -101,6 +101,8 @@ int main(int argc, char *argv[]) break; case 's': todo_send = strtoul(optarg ?: "8", NULL, 0); + if (todo_send > sizeof(dat)) + error(1, 0, "Unsupported size. max: %i", sizeof(dat)); break; case 'r': todo_recv = 1;