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

url: silence MSVC warning #5638

Merged
merged 1 commit into from Jul 2, 2020
Merged

url: silence MSVC warning #5638

merged 1 commit into from Jul 2, 2020

Conversation

@MarcelRaad
Copy link
Member

@MarcelRaad MarcelRaad commented Jul 2, 2020

Since commit f3d501d, if proxy support is disabled, MSVC warns:
url.c : warning C4701: potentially uninitialized local variable
'hostaddr' used
url.c : error C4703: potentially uninitialized local pointer variable
'hostaddr' used

That could actually only happen if both conn->bits.proxy and
CURL_DISABLE_PROXY were enabled.
Initialize it to NULL to silence the warning.

Since commit f3d501d, if proxy support is disabled, MSVC warns:
url.c : warning C4701: potentially uninitialized local variable
'hostaddr' used
url.c : error C4703: potentially uninitialized local pointer variable
'hostaddr' used

That could actually only happen if both `conn->bits.proxy` and
`CURL_DISABLE_PROXY` were enabled.
Initialize it to NULL to silence the warning.

Closes #5638
@MarcelRaad MarcelRaad force-pushed the MarcelRaad:url_msvc_warning branch from 1ffb468 to 19b96ba Jul 2, 2020
@bagder
bagder approved these changes Jul 2, 2020
@MarcelRaad MarcelRaad closed this in 19b96ba Jul 2, 2020
@MarcelRaad MarcelRaad merged commit 19b96ba into curl:master Jul 2, 2020
43 of 46 checks passed
43 of 46 checks passed
@github-actions
fuzzing
Details
@github-actions
macos normal
Details
@github-actions
CodeQL-Build
Details
@github-actions
macos debug
Details
@github-actions
macos libssh2
Details
@github-actions
macos c-ares
Details
@github-actions
macos HTTP only
Details
@github-actions
macos SecureTransport metalink
Details
@github-actions
macos OpenSSL metalink
Details
@github-actions
macos LibreSSL metalink
Details
@github-actions
macos torture
Details
@github-actions
macos cmake clang OpenSSL
Details
@github-actions
macos cmake clang LibreSSL
Details
@github-actions
macos cmake gcc-8 OpenSSL
Details
@github-actions
macos cmake gcc-8 LibreSSL
Details
@github-actions
macos cmake gcc-9 OpenSSL
Details
@github-actions
macos cmake gcc-9 LibreSSL
Details
@azure-pipelines
curl.curl Build #20200702.4 failed
Details
@azure-pipelines
curl.curl (windows windows msys2_mingw32_debug_schannel) windows windows msys2_mingw32_debug_schannel failed
Details
@azure-pipelines
curl.curl (windows windows msys2_mingw64_debug_schannel) windows windows msys2_mingw64_debug_schannel failed
Details
@lgtm-com
LGTM analysis: Python No code changes detected
Details
@github-code-scanning
CodeQL No new alerts
Details
@cirrus-ci
FreeBSD FreeBSD:freebsd-11-3-snap Task Summary
Details
@cirrus-ci
FreeBSD FreeBSD:freebsd-12-1 Task Summary
Details
@lgtm-com
LGTM analysis: C/C++ No new or fixed alerts
Details
@mback2k
buildbot/curl_winssl_cross_x64 Build done.
Details
@mback2k
buildbot/curl_winssl_cross_x64_dbg Build done.
Details
@mback2k
buildbot/curl_winssl_cross_x86 Build done.
Details
@mback2k
buildbot/curl_winssl_cross_x86_dbg Build done.
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@azure-pipelines
curl.curl (linux ubuntu default) linux ubuntu default succeeded
Details
@azure-pipelines
curl.curl (linux ubuntu disable_http_smtp_imap) linux ubuntu disable_http_smtp_imap succeeded
Details
@azure-pipelines
curl.curl (linux ubuntu disable_ipv6) linux ubuntu disable_ipv6 succeeded
Details
@azure-pipelines
curl.curl (linux ubuntu disable_thredres) linux ubuntu disable_thredres succeeded
Details
@azure-pipelines
curl.curl (linux ubuntu http_only) linux ubuntu http_only succeeded
Details
@azure-pipelines
curl.curl (linux ubuntu torture) linux ubuntu torture succeeded
Details
@azure-pipelines
curl.curl (windows windows msys1_mingw32_debug_openssl) windows windows msys1_mingw32_debug_openssl succeeded
Details
@azure-pipelines
curl.curl (windows windows msys1_mingw32_debug_schannel) windows windows msys1_mingw32_debug_schannel succeeded
Details
@azure-pipelines
curl.curl (windows windows msys1_mingw64_debug_openssl) windows windows msys1_mingw64_debug_openssl succeeded
Details
@azure-pipelines
curl.curl (windows windows msys1_mingw64_debug_schannel) windows windows msys1_mingw64_debug_schannel succeeded
Details
@azure-pipelines
curl.curl (windows windows msys1_mingw_debug_openssl) windows windows msys1_mingw_debug_openssl succeeded
Details
@azure-pipelines
curl.curl (windows windows msys1_mingw_debug_schannel) windows windows msys1_mingw_debug_schannel succeeded
Details
@azure-pipelines
curl.curl (windows windows msys2_mingw32_debug_openssl) windows windows msys2_mingw32_debug_openssl succeeded
Details
@azure-pipelines
curl.curl (windows windows msys2_mingw64_debug_openssl) windows windows msys2_mingw64_debug_openssl succeeded
Details
@deepcode-ci-bot
deepcode-ci-bot Well done, no issues found!
Details
@MarcelRaad MarcelRaad deleted the MarcelRaad:url_msvc_warning branch Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants