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

Potentially uninitialized pointer usage in parse_proxy() #3959

Closed
bnason-nf opened this issue May 28, 2019 · 3 comments
Closed

Potentially uninitialized pointer usage in parse_proxy() #3959

bnason-nf opened this issue May 28, 2019 · 3 comments

Comments

@bnason-nf
Copy link
Contributor

Hi,

Starting with curl-7_65_0 when building with MSVC and Whole Program Optimization (/GL and /LTCG), I get a link time warning that parse_proxy() has a potentially uninitialized pointer usage.

I think the linker here is complaining that in parse_proxy(), portptr is defined without being initialized. If the curl_url_get() call that typically initializes portptr exits early because the CURLU parameter is null, then portptr would be uninitialized when it is used in the block immediately following that call.

I'm not sure if this can ever actually happen, bit to address it would be trivial by either initializing portptr to null, or ensuring that all paths of curl_url_get() initialize the third parameter if not null.

I'm happy to submit a pull request for either of these, or some other fix, depending on which you prefer.

Thanks,
Benbuck

@bagder
Copy link
Member

bagder commented May 28, 2019

Thanks. Agreed! Fix pending...

@bagder bagder closed this as completed in 6961322 May 28, 2019
@bagder
Copy link
Member

bagder commented May 28, 2019

The fix was so easy and straight-forward I just pushed it right away!

@bnason-nf
Copy link
Contributor Author

Thanks

@lock lock bot locked as resolved and limited conversation to collaborators Aug 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants