From 425b1b44bc3ac5ac9e8ef2d43efc3cb751577927 Mon Sep 17 00:00:00 2001 From: John Reiser Date: Mon, 9 Jan 2023 09:20:43 -0800 Subject: [PATCH] Initialize output_capacity for loader modified: pefile.cpp --- src/pefile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pefile.cpp b/src/pefile.cpp index 32e8c0ce..f55dae05 100644 --- a/src/pefile.cpp +++ b/src/pefile.cpp @@ -787,7 +787,7 @@ public: int osize = 4 + 2 * nsections; // upper limit for alignments for (unsigned ic = 0; ic < nsections; ic++) osize += sections[ic]->size; - output = New(upx_byte, osize); + output = New(upx_byte, output_capacity = osize); outputlen = 0; // sort the sections by name before adding them all