From 029c1bb0168e3fc6d71846b2ea79e2ac32e29cc2 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 27 Aug 2014 19:49:04 +0200 Subject: [PATCH] fix potential buffer overflow when txt records are forged Signed-off-by: John Crispin --- cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cache.c b/cache.c index e775537..cdc4a79 100644 --- a/cache.c +++ b/cache.c @@ -274,7 +274,7 @@ cache_answer(struct interface *iface, uint8_t *base, int blen, char *name, struc uint8_t v = *p; *p = '\0'; - if (v) + if (v && p + v < &rdata_buffer[rdlength]) p += v + 1; } while (*p); break; -- 2.11.0