Fix crash on empty state response

OpenVPN3 doesn't yet support "state"
management command without parameters.

While this has to be fixed on OpenVPN3
side, it doesn't mean that gui could simply crash.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
pull/525/head
Lev Stipakov 2022-09-02 14:48:01 +03:00
parent 732875d8ff
commit 8a3e864c33
1 changed files with 3 additions and 0 deletions

View File

@ -286,6 +286,9 @@ OnStateChange(connection_t *c, char *data)
{ {
char *pos, *state, *message; char *pos, *state, *message;
if (data == NULL)
return;
pos = strchr(data, ','); pos = strchr(data, ',');
if (pos == NULL) if (pos == NULL)
return; return;