Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential security issue in src/tool_paramhlp.c: Unchecked return from initialization function #5417

Closed
wants to merge 1 commit into from
Closed

Potential security issue in src/tool_paramhlp.c: Unchecked return from initialization function #5417

wants to merge 1 commit into from

Conversation

monocle-ai
Copy link

What is a Conditionally Uninitialized Variable? The return value of a function that is potentially used to initialize a local variable is not checked. Therefore, reading the local variable may result in undefined behavior.

1 instance of this defect were found in the following locations:

Instance 1
File : src/tool_paramhlp.c
Function: strtol

num = strtol(str, &endptr, 10);

Code extract:

    char *endptr;
    long num;
    errno = 0;
    num = strtol(str, &endptr, 10); <------ HERE
    if(errno == ERANGE)
      return PARAM_NUMBER_TOO_LARGE;

@bagder bagder closed this in c5f0a9d May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants