소스 검색

minmea.c - Fix dereference of null pointer error caught by clang's scan-build

Kosma Moczek 3 년 전
부모
커밋
3e984ef657
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      minmea.c

+ 4 - 0
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);