diff options
author | Ben Pfaff <blp@ovn.org> | 2017-12-08 13:24:28 -0800 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2017-12-11 14:31:54 -0800 |
commit | ee97b97c69ca434779830acb42ca7cb0e33ddd5c (patch) | |
tree | 282fc84e68c97ac4f97d88e8bbfb7b4d96fb3c86 | |
parent | d9c23ae693d723335166a99d477a7293344aceb6 (diff) | |
download | openvswitch-ee97b97c69ca434779830acb42ca7cb0e33ddd5c.tar.gz |
ovsdb-idl: Fix assertion failure on error path parsing server reply.
If the database server sent an error reply to a monitor_cond request, and
the error was not a JSON string, then passing the error to json_string()
caused an assertion failure.
Found by inspection.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
-rw-r--r-- | lib/ovsdb-idl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c index c79951f82..6f55ea2ac 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c @@ -502,8 +502,8 @@ ovsdb_idl_run(struct ovsdb_idl *idl) && idl->state == IDL_S_MONITOR_COND_REQUESTED && idl->request_id && json_equal(idl->request_id, msg->id)) { - if (msg->error && !strcmp(json_string(msg->error), - "unknown method")) { + if (msg->error && msg->error->type == JSON_STRING + && !strcmp(json_string(msg->error), "unknown method")) { /* Fall back to using "monitor" method. */ json_destroy(idl->request_id); idl->request_id = NULL; |