From 42eb3c67e5ee5e0a0e8b5175a001bc5822c3a919 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Fri, 16 Jan 2015 16:35:24 +0100 Subject: Fix null pointer dereference in decttl(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Stephen Röttger. --- radsecproxy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/radsecproxy.c b/radsecproxy.c index c83cef4..815e927 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -1173,6 +1173,9 @@ void addttlattr(struct radmsg *msg, uint32_t *attrtype, uint8_t addttl) { int decttl(uint8_t l, uint8_t *v) { int i; + if (l == 0) + return 0; + i = l - 1; if (v[i]) { if (--v[i--]) -- cgit v1.1