소스 검색

Merge pull request #64 from kosma/clang_null

minmea.c - Fix dereference of null pointer error caught by clang's sc…
Kosma Moczek 3 년 전
부모
커밋
ce0fb1d6da
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);