#917198 wpasupplicant: wpa_cli_open_connection does not initializes errno to 0

Package:
wpasupplicant
Source:
wpa
Description:
client support for WPA and WPA2 (IEEE 802.11i)
Submitter:
Vincent Lefevre
Date:
2018-12-23 23:33:06 UTC
Severity:
minor
#917198#5
Date:
2018-12-23 23:29:15 UTC
From:
To:
In wpa_supplicant/wpa_cli.c, wpa_cli_open_connection is expected to
set errno (at least in case of error), as it is used in

                if (!global &&
                    wpa_cli_open_connection(ctrl_ifname, 0) < 0) {
                        fprintf(stderr, "Failed to connect to non-global "
                                "ctrl_ifname: %s  error: %s\n",
                                ctrl_ifname ? ctrl_ifname : "(nil)",
                                strerror(errno));
                        return -1;
                }

Thus wpa_cli_open_connection should start by setting errno to 0,
to make sure that one does not get an error message that comes
from a previous, unrelated error. Currently this is what would
happen when ifname == NULL.