Skip to content

Conversation

@mgovers
Copy link
Member

@mgovers mgovers commented Jan 7, 2026

  • Input sanitization:
    • Check user-provided pointers for nullptr
    • Clearer distinction between "safe" and "unsafe" pointers
  • Refactor the error handling in the C API
    • Explicit illegal operation and other C API exceptions
    • All error handling goes via the same call_with_catch function
    • Custom exception handlers can be provided
    • Fix small bug where the PGM_calculate function was not able to handle nullptr handles
    • NOSONAR the instances of catching generic exceptions and new/delete where they really were intentional

Signed-off-by: Martijn Govers <[email protected]>
@mgovers mgovers self-assigned this Jan 7, 2026
@mgovers mgovers added the improvement Improvement on internal implementation label Jan 7, 2026
Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
@mgovers mgovers marked this pull request as ready for review January 7, 2026 15:20
Copy link
Member

@figueroa1395 figueroa1395 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll finish the rest tomorrow morning, but here is some input already.

@mgovers mgovers force-pushed the feature/input-sanitization branch from 38e8ae5 to df98252 Compare January 8, 2026 14:52
@mgovers
Copy link
Member Author

mgovers commented Jan 8, 2026

there are still more cleanups that are possible, but i have a feeling that the PR is in a decent state as of now. it was fairly hard to merge with main do to conflicts with #1176 but i think the current state is the best of both worlds. can you please do another round of review @figueroa1395 ?

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 8, 2026

@TonyXiang8787 TonyXiang8787 added this pull request to the merge queue Jan 8, 2026
Merged via the queue into main with commit c6c9221 Jan 8, 2026
52 of 58 checks passed
@TonyXiang8787 TonyXiang8787 deleted the feature/input-sanitization branch January 8, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement on internal implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants