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

save_remap_init_segments buffer overflow #91

Open
comex opened this issue May 3, 2020 · 4 comments
Open

save_remap_init_segments buffer overflow #91

comex opened this issue May 3, 2020 · 4 comments

Comments

@comex
Copy link

comex commented May 3, 2020

==19624==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x606000000b00 at pc 0x0001000020d3 bp 0x7ffeefbc6960 sp 0x7ffeefbc6958
READ of size 8 at 0x606000000b00 thread T0
    #0 0x1000020d2 in save_remap_init_segments save.c:91
    #1 0x100007f90 in save_process save.c:640
    #2 0x1000aae50 in main main.c:731

The logic in this function doesn't really make sense. It repeatedly sets seg->entries to newly allocated buffers of size sizeof(remap_entry_ctx_t) (i.e. only one element), then at the end tries to use it like an array (seg->entries[seg->entry_count - 1]).

@shchmue
Copy link
Collaborator

shchmue commented May 3, 2020

i’m not at a computer but yeah i did push a fix for remap #88

@SciresM
Copy link
Owner

SciresM commented May 3, 2020

Oh, nice, thanks! Tagging @shchmue -- I have no idea how the save code in here works, heh.

@SciresM
Copy link
Owner

SciresM commented May 3, 2020

...Is that a PR waiting my review for like six months?

geez, okay, I'll get that sorted.

@shchmue
Copy link
Collaborator

shchmue commented May 3, 2020

no the oldest commit was that long ago the PR is recent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants