Skip to content

Commit

Permalink
try to avoid integer overflow. CID #1445226
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed May 24, 2019
1 parent d944175 commit adf43f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/rlm_isc_dhcp/rlm_isc_dhcp.c
Expand Up @@ -226,7 +226,7 @@ static int refill(rlm_isc_dhcp_tokenizer_t *state)
state->lineno++;
state->line = state->ptr;

if (!fgets(state->ptr, (state->buffer + state->bufsize) - state->ptr, state->fp)) {
if (!fgets(state->ptr, state->bufsize - (state->ptr - state->buffer), state->fp)) {
if (feof(state->fp)) {
state->eof = true;
return 0;
Expand Down

0 comments on commit adf43f6

Please sign in to comment.