mirror of https://github.com/DaveGamble/cJSON.git
Browse Source
Once the check if str is NULL is reached, str has already been derereferenced in the for loop, so in the case that the if clause would be entered, the program has already crashed due to a null pointer dereference. By checking the content of str before dereferencing, the code in the if clause is actually useful. for (ptr=str;*ptr;ptr++) flag|=((*ptr>0 && *ptr<32)||(*ptr=='\"')||(*ptr=='\\'))?1:0; ... if (!str) ...pull/4/head
Max Bruckner
9 years ago
1 changed files with 9 additions and 8 deletions
Loading…
Reference in new issue