From 74c150654f771df22174ae12f60b52720749e910 Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Thu, 28 Jul 2011 18:45:30 +0200 Subject: [PATCH] Fixed invalid access in coap_option_next() --- option.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/option.c b/option.c index ad69b632..0406c556 100644 --- a/option.c +++ b/option.c @@ -55,6 +55,10 @@ coap_option_next(coap_opt_iterator_t *oi) { || coap_option_getb(oi->filter, oi->type) == 0)) { oi->n++; oi->option = options_next(oi->option); + + if (oi->n > oi->optcnt) + break; + oi->type += COAP_OPT_DELTA(oi->option); }