Skip to content

Commit 73cd8a3

Browse files
authored
Merge pull request #20 from ethomson/ethomson/use_after_free
Avoid use-after-free in builtin unicode
2 parents 72ba590 + bcd9642 commit 73cd8a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/unicode_builtin.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,13 +372,13 @@ static inline bool unicode_builtin_encoding_convert(
372372
goto done;
373373
}
374374

375+
out_len = out_start - out;
376+
375377
if ((new_out = realloc(out, out_size)) == NULL) {
376378
ntlm_client_set_errmsg(ntlm, "out of memory");
377379
goto done;
378380
}
379381

380-
out_len = out_start - out;
381-
382382
out = new_out;
383383
out_start = new_out + out_len;
384384
out_end = out + out_size;

0 commit comments

Comments
 (0)