From 3d85c9cd70ec502ac134e218504f8ba7795231f4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Fri, 10 Feb 2017 14:48:36 +0100 Subject: [PATCH 1/1] Check correct attributes when loading service from blob MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We access SERVICE_TXT so we should check for this entry. Checking SERVICE_SERVICE doesn't make sense anyway as it's verified few lines above (in the same funcion). Signed-off-by: Rafał Miłecki Acked-by: John Crispin --- service.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service.c b/service.c index bb87aff..45b9345 100644 --- a/service.c +++ b/service.c @@ -229,7 +229,7 @@ service_load_blob(struct blob_attr *b) if (!_tb[SERVICE_PORT] || !_tb[SERVICE_SERVICE]) return; - if (_tb[SERVICE_SERVICE]) + if (_tb[SERVICE_TXT]) blobmsg_for_each_attr(txt, _tb[SERVICE_TXT], rem2) txt_len += 1 + strlen(blobmsg_get_string(txt)); @@ -248,7 +248,7 @@ service_load_blob(struct blob_attr *b) s->txt_len = txt_len; s->txt = d_txt; - if (_tb[SERVICE_SERVICE]) + if (_tb[SERVICE_TXT]) blobmsg_for_each_attr(txt, _tb[SERVICE_TXT], rem2) { int len = strlen(blobmsg_get_string(txt)); if (!len) -- 2.11.0