mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
sys/suit: return error when URL buffer is too small
This commit is contained in:
parent
43f010c751
commit
68c7bfc20d
@ -424,7 +424,10 @@ static int _dtv_fetch(suit_manifest_t *manifest, int key,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(manifest->urlbuf && url_len < manifest->urlbuf_len);
|
if (!manifest->urlbuf || url_len >= manifest->urlbuf_len) {
|
||||||
|
assert(0);
|
||||||
|
return SUIT_ERR_NO_MEM;
|
||||||
|
}
|
||||||
memcpy(manifest->urlbuf, url, url_len);
|
memcpy(manifest->urlbuf, url, url_len);
|
||||||
manifest->urlbuf[url_len] = '\0';
|
manifest->urlbuf[url_len] = '\0';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user