Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed unlink bug as well as buffer overflow on heap bin init #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions trx_malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
#define unlink(P, BK, FD) \
do { \
FD = P->fd; \
BK = P->BK; \
BK = P->bk; \
FD->bk = BK; \
BK->fd = FD; \
} while (0)
Expand Down Expand Up @@ -176,7 +176,7 @@ struct malloc_state {
bin N-1 (look at the initialization code in trx_malloc() and the bin_at
macro). */

struct malloc_chunk* bins[NBINS * 2 - 2];
struct malloc_chunk* bins[NBINS * 2];
};

/* Thread safety? What is thread safety? TODO */
Expand Down