Skip to content

Conversation

@Krotki
Copy link
Contributor

@Krotki Krotki commented May 14, 2025

When you use tb_out_reserve right away after emitter creation with byte count > 64, it will allocate only 64 bytes and set capacity of to 64.

In elf64.c file we see:

    TB_Emitter strtbl = { 0 };
    tb_out_reserve(&strtbl, 1024); // strtbl will have 64 capacity
    tb_out1b(&strtbl, 0);

with latter usage of tb_out_*_UNSAFE results in overwrite of random memory ...

@RealNeGate RealNeGate merged commit 6f3bd49 into RealNeGate:master Oct 14, 2025
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

Successfully merging this pull request may close these issues.

2 participants