Skip to content

Fix out-of-bounds memory access#16

Open
lumidify wants to merge 1 commit into
perpendicular-dimensions:masterfrom
lumidify:fix-out-of-bounds
Open

Fix out-of-bounds memory access#16
lumidify wants to merge 1 commit into
perpendicular-dimensions:masterfrom
lumidify:fix-out-of-bounds

Conversation

@lumidify

@lumidify lumidify commented Feb 1, 2023

Copy link
Copy Markdown
Contributor

There is a check structure->model->lightmapID[i] >= 0 before actually using lightMap, but since lightMap is already set to bsp->lightmapTextures[structure->model->lightmapID[i]] before that, there is an out-of-bounds memory access when structure->model->lightmapID[i] is less than 0. Since lightMap isn't used anywhere else, it can simply be moved after that check. This was found with -fsanitize=address.

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.

1 participant