Skip to content

Unsafe access to std::vector without bounds check #3627

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

Open
OmarDuran opened this issue Apr 22, 2025 · 1 comment
Open

Unsafe access to std::vector without bounds check #3627

OmarDuran opened this issue Apr 22, 2025 · 1 comment
Assignees
Labels
type: bug Something isn't working type: new A new issue has been created and requires attention

Comments

@OmarDuran
Copy link
Contributor

Describe the bug

In the L478 of file src/coreComponents/common/format/table/TableFormatter.cpp, the code accesses row.cells[columnId - 1] without verifying that columnId > 0, which lead to undefined behavior if columnId == 0. This should be guarded to ensure safe access within vector bounds.

To Reproduce
Steps to reproduce the behavior:

  1. Compile testTable in Debug
  2. ctest -R testTable
@OmarDuran OmarDuran added type: bug Something isn't working type: new A new issue has been created and requires attention labels Apr 22, 2025
@OmarDuran OmarDuran self-assigned this Apr 22, 2025
@arng40
Copy link
Contributor

arng40 commented Apr 29, 2025

This PR solves this issue #3614 (review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working type: new A new issue has been created and requires attention
Projects
None yet
Development

No branches or pull requests

2 participants