Skip to content

openssl: use of variables defined in different scopes #16246

@MarcelRaad

Description

@MarcelRaad

I did this

With warnings-as-errors enabled, Visual Studio 2022 17.4.21 issues the following errors for the 8.12.0 release:

lib\vtls\openssl.c(1595): error C2220: the following warning is treated as an error
lib\vtls\openssl.c(1595): warning C4701: potentially uninitialized local variable 'ca' used
lib\vtls\openssl.c(1595): warning C4703: potentially uninitialized local pointer variable 'ca' used
lib\vtls\openssl.c(1594): warning C4701: potentially uninitialized local variable 'x509' used
lib\vtls\openssl.c(1594): warning C4703: potentially uninitialized local pointer variable 'x509' used
lib\vtls\openssl.c(1593): warning C4701: potentially uninitialized local variable 'pri' used
lib\vtls\openssl.c(1593): warning C4703: potentially uninitialized local pointer variable 'pri' used

This is a regression from 999cc81#diff-03eaf320162ec20f67fab4e16f494e29735dadfa12425530869d42eea86bd2cc, which added gotos to the fail label defined in a different scope and using local variables from that scope.

I expected the following

No warnings about uninitialized variables.

curl/libcurl version

8.12.0

operating system

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions