Commit 5bae87ae authored by Yudong Zhang's avatar Yudong Zhang Committed by Martí Bolívar
Browse files

mgmt: updatehub: fix call to bin2hex



We noticed that in the master branch, updatehub fails to start.
That is because of the behaviour change in bin2hex caused by
commit f2affbd9 ("os: lib: bin2hex: fix memory overwrite").

Fixes: f2affbd9 ("os: lib: bin2hex: fix memory overwrite")
Signed-off-by: default avatarYudong Zhang <mtwget@gmail.com>
parent eb5bbf98
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -97,8 +97,7 @@ static int bin2hex_str(uint8_t *bin, size_t bin_len, char *str, size_t str_buf_l
	}

	memset(str, 0, str_buf_len);
	/* str_buf_len - 1 ensure space for \0 */
	bin2hex(bin, bin_len, str, str_buf_len - 1);
	bin2hex(bin, bin_len, str, str_buf_len);

	return 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ bool updatehub_get_device_identity(char *id, int id_max_len)
	}

	memset(id, 0, id_max_len);
	length = bin2hex(hwinfo_id, (size_t)length, id, id_max_len - 1);
	length = bin2hex(hwinfo_id, (size_t)length, id, id_max_len);

	return length > 0;
}