Skip to content

load_object: fix buffer overruns.#796

Merged
thefallentree merged 2 commits intofluffos:masterfrom
a3a3el:bugfix/load_object_buffer_overrun
Apr 19, 2021
Merged

load_object: fix buffer overruns.#796
thefallentree merged 2 commits intofluffos:masterfrom
a3a3el:bugfix/load_object_buffer_overrun

Conversation

@a3a3el
Copy link
Copy Markdown
Contributor

@a3a3el a3a3el commented Apr 18, 2021

real_name and obname are the same size as name and actualname.
This means that if lname is 400 or more characters long, actualname
and obname will be filled and the strcat calls to append ".c" to
real_name and obname will result in buffer overruns.

Extend real_name and obname to make room for ".c".

Signed-off-by: Jeremy Sowden [email protected]

`real_name` and `obname` are the same size as `name` and `actualname`.
This means that if `lname` is 400 or more characters long, `actualname`
and `obname` will be filled and the `strcat` calls to append `".c"` to
`real_name` and `obname` will result in buffer overruns.

Extend `real_name` and `obname` to make room for `".c"`.

Signed-off-by: Jeremy Sowden <[email protected]>
@thefallentree thefallentree merged commit 0d19982 into fluffos:master Apr 19, 2021
Amirani-al pushed a commit to Amirani-al/fluffos that referenced this pull request May 30, 2023
* load_object: fix buffer overruns.

`real_name` and `obname` are the same size as `name` and `actualname`.
This means that if `lname` is 400 or more characters long, `actualname`
and `obname` will be filled and the `strcat` calls to append `".c"` to
`real_name` and `obname` will result in buffer overruns.

Extend `real_name` and `obname` to make room for `".c"`.

Signed-off-by: Jeremy Sowden <[email protected]>

* Update src/vm/internal/simulate.cc

Co-authored-by: Yucong Sun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants