Skip to content

Commit

Permalink
fix(file): incorrect munmap size
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Apr 4, 2024
1 parent fb9b5c0 commit 2abcc14
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2abcc14

Please sign in to comment.