Browse Source

iniparser: Prevent possible NULL ptr deref.

Georgi Chorbadzhiyski 9 years ago
parent
commit
a0000fff97
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      iniparser.c

+ 3
- 1
iniparser.c View File

@@ -523,7 +523,9 @@ static line_status iniparser_line(
523 523
          * key=;
524 524
          * key=#
525 525
          */
526
-        strcpy(key, strstrip(key));
526
+        char *skey = strstrip(key);
527
+        if (skey)
528
+            strcpy(key, skey);
527 529
         strcpy(key, strlwc(key));
528 530
         value[0]=0 ;
529 531
         sta = LINE_VALUE ;

Loading…
Cancel
Save