From 2abcc1489a73fed7c39219798ee43d2a74d9c193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Thu, 4 Apr 2024 21:46:44 +0900 Subject: [PATCH] fix(file): incorrect munmap size --- file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/file.c b/file.c index 62f3f34..c6953ff 100644 --- a/file.c +++ b/file.c @@ -173,11 +173,11 @@ base16384_err_t base16384_encode_file_detailed(const char* input, const char* ou int n = base16384_encode(input_file, (int)inputsize, decbuf); if(n && fwrite(decbuf, n, 1, fpo) <= 0) { goto_base16384_file_detailed_cleanup(encode, base16384_err_write_file, { - munmap(input_file, (size_t)inputsize); + munmap(input_file, (size_t)inputsize+16); close(fd); }); } - munmap(input_file, (size_t)inputsize); + munmap(input_file, (size_t)inputsize+16); close(fd); } #endif @@ -321,11 +321,11 @@ base16384_err_t base16384_decode_file_detailed(const char* input, const char* ou int n = base16384_decode(input_file+off, inputsize-off, encbuf); if(n && fwrite(encbuf, n, 1, fpo) <= 0) { goto_base16384_file_detailed_cleanup(decode, base16384_err_write_file, { - munmap(input_file, (size_t)inputsize); + munmap(input_file, (size_t)inputsize+16); close(fd); }); } - munmap(input_file, (size_t)inputsize); + munmap(input_file, (size_t)inputsize+16); close(fd); } #endif