Created
April 22, 2020 09:46
-
-
Save bagder/d75e10b5bd9781c97b1f14591a6ddb4e to your computer and use it in GitHub Desktop.
gcc-10 -fanalyze complaint on version.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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