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 off-by-one error in CopyListEntries that could end up creating lists in which the last element is unbound #4928

Merged
merged 1 commit into from
Jul 7, 2022

Conversation

ChrisJefferson
Copy link
Contributor

The length of the list may be changed if we add new members to the
list to the end of list, or unbind the final element.

Fixes #4927

The length of the list may be changed if we add new members to the
list to the end of list, or unbind the final element.
@fingolfin
Copy link
Member

In GAP 4.4, when this wasn't a kernel function yet, the problematic code triggered an error. I wonder: do we really want to support copying "unbound entries" via CopyListEntries?

@fingolfin fingolfin added kind: bug Issues describing general bugs, and PRs fixing them topic: kernel labels Jul 6, 2022
Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

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

It's fine by me to merge this, but I really wonder if instead we should reject inputs that would lead to "copying" of unbound entries?

@ChrisJefferson
Copy link
Contributor Author

Banning copying unbound members would mean we couldn't use SyMemmove for the most efficient case (although this function seems to do lots of things, I wonder how often it's even used with a step value other than 1?)

@fingolfin fingolfin merged commit a40ffa3 into gap-system:master Jul 7, 2022
@ChrisJefferson ChrisJefferson deleted the fix-CopyListEntries branch July 7, 2022 12:55
@fingolfin fingolfin added the release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes label Aug 17, 2022
@fingolfin fingolfin changed the title Fix off-by-one error in CopyListEntries Fix off-by-one error in CopyListEntries that could end up creating lists in which the last element is unbound Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Issues describing general bugs, and PRs fixing them release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes topic: kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CopyListEntries can create lists when the last element is unbound
2 participants