Skip to content

Validate vertex indices in GetParallelogramEntries - #1191

Open
TristanInSec wants to merge 1 commit into
google:mainfrom
TristanInSec:validate-parallelogram-vertex-index
Open

Validate vertex indices in GetParallelogramEntries#1191
TristanInSec wants to merge 1 commit into
google:mainfrom
TristanInSec:validate-parallelogram-vertex-index

Conversation

@TristanInSec

Copy link
Copy Markdown

Summary

  • Add bounds checks for vertex indices returned by CornerTable::Vertex() before using them as indices into vertex_to_data_map
  • Return sentinel values (-1) when vertex indices are invalid or out of range
  • Prevents out-of-bounds access when the corner table contains degenerate entries

Test plan

  • Verified the fix handles kInvalidVertexIndex (UINT32_MAX) correctly
  • Verified the fix handles indices >= vertex_to_data_map.size() correctly
  • Existing callers already handle -1 return values (skip prediction)
Check that vertex indices returned by the corner table are valid
and within bounds of vertex_to_data_map before using them as array
indices.
@TristanInSec

Copy link
Copy Markdown
Author

Hi, friendly ping on this PR and the related #1192. Happy to address any feedback. Thanks!

@TristanInSec

Copy link
Copy Markdown
Author

Hi, friendly ping on this PR and the related #1192. Let me know if any changes are needed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant