mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 13:11:31 +00:00
tpm: Check that parse_byte_string() has data to parse
Rather then crashing when there is no data, print an error. The error is printed by the caller to parse_byte_string(). Acked-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
parent
21baf15b4e
commit
5c51d8aa0e
1 changed files with 2 additions and 0 deletions
|
@ -58,6 +58,8 @@ static void *parse_byte_string(char *bytes, uint8_t *data, size_t *count_ptr)
|
|||
size_t count, length;
|
||||
int i;
|
||||
|
||||
if (!bytes)
|
||||
return NULL;
|
||||
length = strlen(bytes);
|
||||
count = length / 2;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue