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@nordu.net>2015-01-16 16:51:13 +0100
commit42eb3c67e5ee5e0a0e8b5175a001bc5822c3a919 (patch)
tree89c332862bac71af6b5f7e51fb1a43fc08e7eaf9 /radsecproxy.c
parenteb4368602284057b6af5cd98d04dc1df719304d5 (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 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--])