Make deamon checks received IPC commands for correctness. --- android/main.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/android/main.c b/android/main.c index 75004cf..85ea270 100644 --- a/android/main.c +++ b/android/main.c @@ -236,13 +236,8 @@ static gboolean cmd_watch_cb(GIOChannel *io, GIOCondition cond, goto fail; } - if (ret < (ssize_t) sizeof(*msg)) { - error("HAL command too small, terminating (%zd)", ret); - goto fail; - } - - if (ret != (ssize_t) (sizeof(*msg) + msg->len)) { - error("Malformed HAL command (%zd bytes), terminating", ret); + if (!hal_cmd_check(msg, msg->payload, ret)) { + error("IPC protocol error, terminating"); goto fail; } -- 1.8.4.2 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html