Skip to content

Conversation

@stratakis
Copy link

When a HighsSimplexBadBasisChangeRecord is created, save_value is not set until later in applyTabooRowOut/applyTabooVariableIn. Pushing the struct with an uninitialized field copies garbage memory.

Found via Coverity static analysis

When a HighsSimplexBadBasisChangeRecord is created, save_value is not
set until later in applyTabooRowOut/applyTabooVariableIn. Pushing the
struct with an uninitialized field copies garbage memory.

Found via Coverity static analysis
@stratakis
Copy link
Author

Coverity message:

 17. scipy-1.16.2/subprojects/highs/src/simplex/HEkk.cpp:4022:5: var_decl: Declaring variable "record" without initializer.
18. scipy-1.16.2/subprojects/highs/src/simplex/HEkk.cpp:4028:5: uninit_use_in_call: Using uninitialized value "record". Field "record.save_value" is uninitialized when calling "push_back". [Note: The source code implementation of the function has been overridden by a builtin model.]
  4026|       record.variable_in = variable_in;
  4027|       record.reason = reason;
  4028|->     bad_basis_change_.push_back(record);
  4029|       bad_basis_change_num = bad_basis_change_.size() - 1;
  4030|     } else {

@jajhall jajhall self-requested a review January 14, 2026 10:18
Copy link
Member

@jajhall jajhall left a comment

Choose a reason for hiding this comment

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

Well spotted, thanks!

@jajhall jajhall merged commit 6b1068b into ERGO-Code:latest Jan 14, 2026
237 of 238 checks passed
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