Skip to content

Commit

Permalink
Fix null pointer dereference in decttl().
Browse files Browse the repository at this point in the history
Patch by Stephen Röttger.
  • Loading branch information
Linus Nordberg authored and Linus Nordberg committed Jan 16, 2015
1 parent eb43686 commit 42eb3c6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions radsecproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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--])
Expand Down

0 comments on commit 42eb3c6

Please sign in to comment.