Skip to content

Potentially uninitialized pointer usage in parse_proxy() #3959

@bnason-nf

Description

@bnason-nf

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions