File fix-use-after-free.patch of Package indent
commit c2b74c05435c59225badaeeb2a5e40c20284528a
Author: Dan Collins <dcollinsn@gmail.com>
Date: Sun Aug 9 20:26:37 2020 +0200
Fix use after free error
Need_chars was called, and it is possible for xrealloc to return a new
pointer, leaving buf_ptr possibly a dangling reference.
Bug: #58924
diff --git a/src/handletoken.c b/src/handletoken.c
index b17dee1..e45495a 100644
--- a/src/handletoken.c
+++ b/src/handletoken.c
@@ -1972,8 +1972,8 @@ static void handle_token_preesc(
bp_save = buf_ptr;
be_save = buf_end;
- buf_ptr = save_com.ptr;
need_chars (&save_com, 1);
+ buf_ptr = save_com.ptr;
buf_end = save_com.end;
save_com.end = save_com.ptr; /* make save_com empty */
}