Skip to content

Instantly share code, notes, and snippets.

@bagder
Created April 22, 2020 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bagder/d75e10b5bd9781c97b1f14591a6ddb4e to your computer and use it in GitHub Desktop.
Save bagder/d75e10b5bd9781c97b1f14591a6ddb4e to your computer and use it in GitHub Desktop.
gcc-10 -fanalyze complaint on version.c
CC libcurl_la-version.lo
version.c: In function ‘curl_version’:
version.c:216:16: warning: use of uninitialized value ‘<unknown>’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
216 | size_t n = strlen(src[j]);
| ^~~~~~~~~~~~~~
‘curl_version’: events 1-9
|
| 215 | for(j = 0; j < i; j++) {
| | ^~~
| | |
| | (1) following ‘true’ branch (when ‘j != 8’)...
| | (7) following ‘true’ branch (when ‘j != 8’)...
| 216 | size_t n = strlen(src[j]);
| | ~~~~~~~~~~~~~~
| | |
| | (2) ...to here
| | (8) ...to here
| | (9) use of uninitialized value ‘<unknown>’ here
| 217 | /* we need room for a space, the string and the final zero */
| 218 | if(outlen <= (n + 2))
| | ~
| | |
| | (3) following ‘false’ branch...
| 219 | break;
| 220 | if(j) {
| | ~
| | |
| | (4) ...to here
| | (5) following ‘false’ branch (when ‘j == 0’)...
|......
| 225 | memcpy(outp, src[j], n);
| | ~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | (6) ...to here
|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment