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:
Olaf Bergmann committed 2011-06-19 00:26:48 +02:00
1 parent 43dd1fce00
commit e2e6c8c89b
1 file changed
-4
-4
View File
@@ -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;