Skip to content
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

Fix the size formula for an allocation #307

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions linbox/blackbox/apply.h
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,10 @@ namespace LinBox
*/
int rclen = (int)num_chunks*2 + 5;

unsigned char* combined = new unsigned char[(size_t)rc*_n*(size_t)rclen];
memset(combined, 0, (size_t)rc*_n*(size_t)rclen);
// https://github.com/linbox-team/linbox/issues/304#issuecomment-1766621021
size_t combined_size = (size_t)rc*_n*(size_t)rclen + 1;
unsigned char* combined = new unsigned char[combined_size];
memset(combined, 0, combined_size);

//order from major index to minor: combining index, component of sol'n, byte
//compute a product (chunk times x) for each chunk
Expand Down