siva-msft / curl

Other
0 stars 0 forks source link

Potential security issue in src/tool_urlglob.c: Unchecked return from initialization function #78

Open monocle-ai opened 4 years ago

monocle-ai commented 4 years ago

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_urlglob.c Function: strtoul https://github.com/siva-msft/curl/blob/a051c0f0a9057a792ce7dfa22bf761d36fc56a72/src/tool_urlglob.c#L204 Code extract:

      if(end_c == ':') {
        char *endp;
        errno = 0;
        step = strtoul(&pattern[4], &endp, 10); <------ HERE
        if(errno || &pattern[4] == endp || *endp != ']')
          step = 0;