Skip to content

Commit

Permalink
Check that list is nonempty before calling factory function
Browse files Browse the repository at this point in the history
Otherwise we get a segfault
  • Loading branch information
d-torrance committed Sep 25, 2024
1 parent 9e7ce27 commit 518a13c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions M2/Macaulay2/e/interface/factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,11 @@ M2_arrayintOrNull rawIdealReorder(const Matrix *M)
}
}

if (I.length() == 0) {
ERROR("expected at least one generator");
return nullptr;
}

List<int> t = neworderint(I);

int n = t.length();
Expand Down

0 comments on commit 518a13c

Please sign in to comment.