Skip to content

Issue #1739 is not resolved after revision #1852

@whichbug

Description

@whichbug

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions