From 3e984ef657170143868ef7b342cb86691600e39b Mon Sep 17 00:00:00 2001 From: Kosma Moczek Date: Thu, 2 Jun 2022 22:41:02 +0200 Subject: [PATCH] minmea.c - Fix dereference of null pointer error caught by clang's scan-build --- minmea.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/minmea.c b/minmea.c index 98bc215..a77dc2c 100644 --- a/minmea.c +++ b/minmea.c @@ -93,6 +93,10 @@ bool minmea_scan(const char *sentence, const char *format, ...) { bool result = false; bool optional = false; + + if (sentence == NULL) + return false; + va_list ap; va_start(ap, format);