summaryrefslogtreecommitdiff
path: root/radsecproxy.c
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2015-01-16 16:35:24 +0100
committerLinus Nordberg <linus@nordberg.se>2015-01-16 16:35:24 +0100
commit47a7af88884c9887cbe0fc19da8d8d237e1b9054 (patch)
treee5af6631ea415bc9c69e7da9dc74bc964e8014d2 /radsecproxy.c
parent0c7f02c751405864266b78f0e358bbc28609e3ba (diff)
Fix null pointer dereference in decttl().
Patch by Stephen Röttger.
Diffstat (limited to 'radsecproxy.c')
-rw-r--r--radsecproxy.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/radsecproxy.c b/radsecproxy.c
index 505afd0..7d4103e 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -1160,6 +1160,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--])