Skip to content

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

Closed
monocle-ai wants to merge 1 commit into
curl:masterfrom
monocle-ai:tool_paramhlp-cuv-2020-05-18-08-59-58-5417
Closed

Potential security issue in src/tool_paramhlp.c: Unchecked return from initialization function#5417
monocle-ai wants to merge 1 commit into
curl:masterfrom
monocle-ai:tool_paramhlp-cuv-2020-05-18-08-59-58-5417

Conversation

@monocle-ai

Copy link
Copy Markdown

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.

2 participants