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

Possible memory leak #18

Closed
Kylogias opened this issue Jul 20, 2021 · 2 comments
Closed

Possible memory leak #18

Kylogias opened this issue Jul 20, 2021 · 2 comments

Comments

@Kylogias
Copy link
Contributor

There is a possible memory leak in the load function of emu/libemu.c where the file may be bigger than 32K (the size of ROM) or even 64K (the size of the entire memory). This can leave to corrupted data when, for example, the screen is reading from memory, or another process modifies memory, or even the PROGRAM ITSELF modifies memory as it'll have an unknown size when assembled, thus you may read into/from memory that has program code

@huntears
Copy link

I just looked at the code and it looks like it doesn't.
emu_memcpy is protected against writing out of memory by the ppeek function in common/jdh8.h where this lines appears :

    if (addr >= ADDR_MB) {
        return &((u8 *) state->special.raw)[addr - ADDR_MB];

Here I think the only thing that could happen is that the memory would be overwritten.

@jdah
Copy link
Owner

jdah commented Oct 22, 2021

Not a memory leak, but this should warn. Fixed in b5f7827, thanks!

@jdah jdah closed this as completed Oct 22, 2021
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