Skip to content

gurobi: no buffer overrun on a quadratic then nonquadratic constraint - #37

Open
glebbelov wants to merge 1 commit into
masterfrom
task-041/gurobi-qc-buffer-fix
Open

glebbelov wants to merge 1 commit into
masterfrom
task-041/gurobi-qc-buffer-fix

Conversation

@glebbelov

Copy link
Copy Markdown
Contributor

mqpcheckv's negative (error) return was assigned to the unsigned maximum of quadratic-constraint sizes, which wrapped and shrank the allocation; the driver then wrote past the buffer before rejecting the model. Found by an AddressSanitizer end2end run.

mqpcheckv's negative (error) return was assigned to the unsigned maximum
of quadratic-constraint sizes, which wrapped and shrank the allocation;
the driver then wrote past the buffer before rejecting the model.
Found by an AddressSanitizer end2end run.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

@fdabrandao fdabrandao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed: the nelqc > 0 guard fixes the signed/unsigned comparison. A negative mqpcheckv return was converted to a huge unsigned value, so k became about SIZE_MAX and the Malloc size overflowed. Errors are still reported by the later loop (solve_result_num 522/525).

Minor, non-blocking: the changelog entry sits under an 'unreleased' heading, while earlier entries use dated headings, so it needs updating at release time.

I read the diff and the surrounding code but did not build or run it.

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.

2 participants