Stefano Babic
unread,Jun 7, 2017, 2:03:57 PM6/7/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to swup...@googlegroups.com, Stefano Babic, Sid-Ali Teir, Georges Savoundararadj, Romain Bazile
Commit 93f9b1972676a53ee7a8a44f5b069b04a3c2ed57 introduces a bug if the
new attribute "offset" is not set. In fact, it retrieves the value with
GET_FIELD_STRING, but this function does not touch the destination if no
attribute is found.
Initialize the attribute with an empty string before retrieving the
field.
Signed-off-by: Stefano Babic <
sba...@denx.de>
CC: Sid-Ali Teir <
st...@witekio.us>
CC: Georges Savoundararadj <
gsavoun...@witekio.us>
CC: Romain Bazile <
romain...@ubiant.com>
---
parser/parser.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/parser/parser.c b/parser/parser.c
index 2fc9a4f..6ad9741 100644
--- a/parser/parser.c
+++ b/parser/parser.c
@@ -388,6 +388,12 @@ static void parse_images(parsertype p, void *cfg, struct swupdate_cfg *swcfg)
return;
}
+ /*
+ * GET_FIELD_STRING does not touch the passed string if it is not
+ * found, be sure that it is empty
+ */
+ seek_str[0] = '\0';
+
GET_FIELD_STRING(p, elem, "name", image->
id.name);
GET_FIELD_STRING(p, elem, "version", image->id.version);
GET_FIELD_STRING(p, elem, "filename", image->fname);
--
2.7.4