Skip to content

Commit

Permalink
Don't risk calling _validauth() with sec == NULL.
Browse files Browse the repository at this point in the history
buf2radmsg() is never called with rqauth != NULL and secret == NULL
but let's protect against future callers.

coverity: 1449519
  • Loading branch information
Linus Nordberg committed Aug 1, 2017
1 parent 633e4b8 commit 3a5d0a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion radmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ struct radmsg *buf2radmsg(uint8_t *buf, uint8_t *secret, uint8_t *rqauth) {
}
}

if (rqauth && !_validauth(buf, rqauth, secret)) {
if (rqauth && secret && !_validauth(buf, rqauth, secret)) {
debug(DBG_WARN, "buf2radmsg: Invalid auth, ignoring reply");
return NULL;
}
Expand Down

0 comments on commit 3a5d0a0

Please sign in to comment.