mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-26 00:41:42 +03:00
bugfiy: initialize parse iterator even when string is empty or NULL pointer
Thanks to Jörg Wolf for pointing this out
This commit is contained in:
1 parent
43dd1fce00
commit
e2e6c8c89b
1 file changed
-4
@@ -506,13 +506,9 @@ coap_parse_iterator_init(unsigned char *s, size_t n,
|
||||
unsigned char separator,
|
||||
unsigned char *delim, size_t dlen,
|
||||
coap_parse_iterator_t *pi) {
|
||||
assert(s);
|
||||
assert(pi);
|
||||
assert(separator);
|
||||
|
||||
if (!s || !n)
|
||||
return NULL;
|
||||
|
||||
pi->separator = separator;
|
||||
pi->delim = delim;
|
||||
pi->dlen = dlen;
|
||||
|
||||
Reference in new issue
Block a user