Skip to content

Commit

Permalink
append all VPs, not just the first one.
Browse files Browse the repository at this point in the history
it's rather surprising to see fr_cursor_append() set vp->next=NULL
which causes all kinds of issues with callers expecting something
else.
  • Loading branch information
alandekok committed Jun 5, 2018
1 parent 2446519 commit aca79ea
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lib/util/pair.c
Expand Up @@ -1652,7 +1652,7 @@ int fr_pair_list_afrom_file(TALLOC_CTX *ctx, VALUE_PAIR **out, FILE *fp, bool *p
char buf[8192];
FR_TOKEN last_token = T_EOL;

fr_cursor_t cursor;
fr_cursor_t cursor, to_append;

VALUE_PAIR *vp = NULL;
fr_cursor_init(&cursor, out);
Expand Down Expand Up @@ -1685,9 +1685,8 @@ int fr_pair_list_afrom_file(TALLOC_CTX *ctx, VALUE_PAIR **out, FILE *fp, bool *p
break;
}

do {
fr_cursor_append(&cursor, vp);
} while (vp->next && (vp = vp->next));
fr_cursor_init(&to_append, &vp);
fr_cursor_merge(&cursor, &to_append);

buf[0] = '\0';
}
Expand Down

0 comments on commit aca79ea

Please sign in to comment.