Skip to content

Commit

Permalink
Merge pull request #20 from ethomson/ethomson/use_after_free
Browse files Browse the repository at this point in the history
Avoid use-after-free in builtin unicode
  • Loading branch information
ethomson authored Dec 21, 2023
2 parents 72ba590 + bcd9642 commit 73cd8a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/unicode_builtin.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,13 +372,13 @@ static inline bool unicode_builtin_encoding_convert(
goto done;
}

out_len = out_start - out;

if ((new_out = realloc(out, out_size)) == NULL) {
ntlm_client_set_errmsg(ntlm, "out of memory");
goto done;
}

out_len = out_start - out;

out = new_out;
out_start = new_out + out_len;
out_end = out + out_size;
Expand Down

0 comments on commit 73cd8a3

Please sign in to comment.