Openconnect crashes on auth dialog
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
network-manager-openconnect (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
The authentication dialog of openconnect crashes.
Steps to reproduce:
Add net vpn connection in Gui:
* Settings -> Network -> VPN -> +
* Selecct "Multi-protocol vpn client (openconnect)"
* Select "Cisco AnyConnect or openconnect"
* Enter as gateway "vpn.sydney.edu.au"
* Click "Add"
* Activate the newly added VPN
* Click "Connect"
Now the login window briefly shows up before it disappears without error message or anything.
The syslog contains the following lines indicating that the authentication dialog segfaulted.
Sep 27 10:44:06 durian kernel: [214841.848187] nm-openconnect-
Sep 27 10:44:06 durian kernel: [214841.848205] Code: 66 2e 0f 1f 84 00 00 00 00 00 49 8b 3e 49 83 c6 08 e8 f4 d1 ff ff 4c 39 f5 75 ef 48 8b 7c 24 10 31 ed e8 e3 d1 ff ff 0f 1f 00 <49> 8b 3c ec 48 83 c5 01 e8 d3 d1 ff ff 39 eb 7f ef 4c 89 e7 e8 c7
The system is Ubuntu 22.04, recently updated from 20.04. I attached the output of
ubuntu-bug network-
To this report.
affects: | apport (Ubuntu) → network-manager-openconnect (Ubuntu) |
I did some debugging and found the reason for the crash: an array is attempted to be freed even though it could be NULL.
Below is the code fragment with the missing if-statenment inserted.
In auth-dialog/main.c around line 720:
function static void cookie_cb (GObject *source_obj, GAsyncResult *res, gpointer data):
free(cookie_ array[i] ); cookie_ array);
[...]
for (i = 0; i < 2 * (num_cookies + 1); i++) {
}
free(
if (headers_array) { // <=========== THIS LINE IS MISSING AND MUST BE ADDED
free( headers_ array[i] );
free(headers_ array);
soup_message_ headers_ free (headers);
for (i = 0; i < 2 * (num_headers + 1); i++) {
}
} // <=========== THIS LINE IS MISSING AND MUST BE ADDED
if (headers)