From fca1b42abe3eb6057d522694b80e92d70b3e51cc Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 8 Dec 2017 13:24:28 -0800 Subject: [PATCH] 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 Acked-by: Alin Gabriel Serdean --- lib/ovsdb-idl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c index 7475b6927..ad1c237da 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c @@ -552,8 +552,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;