Browse Source

Merge pull request #64 from kosma/clang_null

minmea.c - Fix dereference of null pointer error caught by clang's sc…
Kosma Moczek 3 năm trước cách đây
mục cha
commit
ce0fb1d6da
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  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);