Browse code

Add NULL check in cli_isnumber

Andrew authored on 2019/11/09 04:25:42
Showing 1 changed files
... ...
@@ -910,6 +910,10 @@ size_t cli_ldbtokenize(char *buffer, const char delim, const size_t token_count,
910 910
 
911 911
 int cli_isnumber(const char *str)
912 912
 {
913
+    if (NULL == str) {
914
+        return 0;
915
+    }
916
+
913 917
     while (*str)
914 918
         if (!strchr("0123456789", *str++))
915 919
             return 0;