Check the uuid_str_to_bin return value, skip the node
if the image-type-id property is wrong format.
Addresses-Coverity-ID: 463145 ("Error handling issues")
Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
const fdt32_t *val;
const char *guid_str;
int len, offset, index;
- int parent;
+ int parent, ret;
*lsv = 0;
guid_str = fdt_getprop(fdt, offset, "image-type-id", &len);
if (!guid_str)
continue;
- uuid_str_to_bin(guid_str, guid.b, UUID_STR_FORMAT_GUID);
+ ret = uuid_str_to_bin(guid_str, guid.b, UUID_STR_FORMAT_GUID);
+ if (ret < 0) {
+ log_warning("Wrong image-type-id format.\n");
+ continue;
+ }
val = fdt_getprop(fdt, offset, "image-index", &len);
if (!val)