Clang's static analyzer reports that the function nyoci_outbound_set_uri() uses an uninitialized variable toport in some call paths; this seems a legit bug and not a false positive.
src/libnyoci/nyoci-outbound.c:501:9: warning: 2nd function call argument is an uninitialized value
ret = nyoci_plat_set_remote_hostname_and_port(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This occurs when components.host is non-null but components.protocol and components.port are null. The flow of control bypasses the three lines where toport is assigned but falls through to a line where it's passed to nyoci_plat_set_remote_hostname_and_port().
Xcode doesn't produce a textual version of the detailed flow-control analysis, but here's a screenshot:
Clang's static analyzer reports that the function
nyoci_outbound_set_uri()
uses an uninitialized variabletoport
in some call paths; this seems a legit bug and not a false positive.This occurs when
components.host
is non-null butcomponents.protocol
andcomponents.port
are null. The flow of control bypasses the three lines wheretoport
is assigned but falls through to a line where it's passed tonyoci_plat_set_remote_hostname_and_port()
.Xcode doesn't produce a textual version of the detailed flow-control analysis, but here's a screenshot: