]> www.infradead.org Git - users/dwmw2/openconnect.git/commit
Fix double-free when client repeatedly fails to pull GlobalProtect client config
authorDaniel Lenski <dlenski@gmail.com>
Sun, 29 Sep 2019 20:36:44 +0000 (13:36 -0700)
committerDaniel Lenski <dlenski@gmail.com>
Sun, 29 Sep 2019 20:45:29 +0000 (13:45 -0700)
commit6034670715965dfe5d0678b3f497d1bf8a884dbb
tree481dd1d258d48b44169b37931b2d00632fe067b0
parent2bcaee159b067f8ce73792e3a2e4a76c368c60a6
Fix double-free when client repeatedly fails to pull GlobalProtect client config

When openconnect attempts to rebuild the GP connection, upon rekey or
loss-of-connectivity, it re-requests the client configuration XML
(/ssl-vpn/getconfig.esp).  It saves the old `cstp_options` prior to querying
the new ones, and then free()'s them after verifying that the IP addresses
and netmasks haven't changed.

If the config request fails to return valid XML twice in a row, the old
`cstp_options` would be double-freed, causing the crash described in
https://gitlab.com/openconnect/openconnect/issues/78.

The fix is to ensure that the old `cstp_options` are set to NULL as soon as
they're copied into `old_cstp_options`.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
gpst.c