From dde3eda412d5fc8be118f7569f4014d39be5c402 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Thu, 23 Jan 2020 14:46:24 -0800 Subject: low-can: fix aborting on can_data not being an json_type_array Bug-AGL: SPEC-3129 Change-Id: I41928c5f4c467edb176ad6234c9b775e70035319 Signed-off-by: Matt Ranostay --- low-can-binding/binding/low-can-cb.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'low-can-binding/binding') diff --git a/low-can-binding/binding/low-can-cb.cpp b/low-can-binding/binding/low-can-cb.cpp index 3897f8b4..d994dd24 100644 --- a/low-can-binding/binding/low-can-cb.cpp +++ b/low-can-binding/binding/low-can-cb.cpp @@ -558,7 +558,9 @@ static void write_raw_frame(afb_req_t request, const std::string& bus_name, mess message->set_maxdlen(J1939_MAX_DLEN); #endif - if(message->get_length() > 0 && message->get_length() <= message->get_maxdlen()) + if(message->get_length() > 0 && + message->get_length() <= message->get_maxdlen() && + json_object_get_type(can_data) == json_type_array) { std::vector data; for (int i = 0 ; i < message->get_length() ; i++) -- cgit 1.2.3-korg