Skip to content

Commit

Permalink
files: Only copy pairs if there are pairs to copy (ubsan)
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Jun 4, 2020
1 parent 21a5208 commit 0f32839
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/modules/rlm_files/rlm_files.c
Expand Up @@ -359,9 +359,10 @@ static rlm_rcode_t file_common(rlm_files_t const *inst, REQUEST *request, char c
found = true;

/* ctx may be reply */
MEM(fr_pair_list_copy(reply, &reply_tmp, pl->reply) >= 0);

radius_pairmove(request, &reply->vps, reply_tmp, true);
if (pl->reply) {
MEM(fr_pair_list_copy(reply, &reply_tmp, pl->reply) >= 0);
radius_pairmove(request, &reply->vps, reply_tmp, true);
}
fr_pair_list_move(&request->control, &check_tmp);

reply_tmp = NULL; /* radius_pairmove() frees input attributes */
Expand Down

0 comments on commit 0f32839

Please sign in to comment.