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

code allocates one byte and then overrun it with many #8

Open
vtolkov opened this issue Jul 8, 2024 · 0 comments
Open

code allocates one byte and then overrun it with many #8

vtolkov opened this issue Jul 8, 2024 · 0 comments

Comments

@vtolkov
Copy link

vtolkov commented Jul 8, 2024

char *base = malloc(sizeof(char) * 1);
base[0] = '\0';
strncat(base, hash, hash_length - 1);

1 byte buffer is overwritten by strncat.

@vtolkov vtolkov changed the title really, it should be tested before publishing code allocates one byte and then overrun it with many Jul 8, 2024
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

1 participant