From 0dace23021de55996d7e7f73a78e9d23e687ff46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Sat, 27 Nov 2021 19:24:51 +0100 Subject: [PATCH] Bugfix: Fix null pointer access in temp profile parser --- stm-firmware/temp-profile/temp-profile-parser.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stm-firmware/temp-profile/temp-profile-parser.c b/stm-firmware/temp-profile/temp-profile-parser.c index 28b9d7a..a87e9b2 100644 --- a/stm-firmware/temp-profile/temp-profile-parser.c +++ b/stm-firmware/temp-profile/temp-profile-parser.c @@ -141,6 +141,10 @@ static int parse_line(char *line, struct pl_command *cmd) switch (token_idx) { case 0: map = string_to_command(token); + if (!map) { + /* No valid command found */ + return -1; + } c.cmd = map->command; break; default: