-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Issue #1739 is not resolved after revision #1852
Copy link
Copy link
Closed
Labels
Description
I just found that Issue #1739 is not totally resolved after the revision: f19a96e
Issue #1739 stated that mode_str in the following code may be null and may cause a null pointer dereference bug when calling strcmp.
char *mode_str = to_string(value);
if (strcmp(mode_str, "tcp_only") == 0) conf.mode = TCP_ONLY;
Then the developer revised as below (f19a96e), which cannot avoid the null pointer dereference.
char *mode_str = to_string(value);
if (mode_str == NULL) conf.mode = TCP_ONLY;
if (strcmp(mode_str, "tcp_only") == 0) conf.mode = TCP_ONLY;
In my opinion, an "else" should be put at the beginning of the second if statement.
Reactions are currently unavailable