Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

sudo_mmap_strdup_v1: Fix potential NULL pointer deref #205

Merged
merged 1 commit into from
Nov 20, 2022

Conversation

BornThisWay
Copy link
Contributor

Copy link
Collaborator

@millert millert left a comment

Choose a reason for hiding this comment

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

errno is already set by sudo_mmap_alloc_v1 so no need to set it again. I think it would be better to just do

if (newstr != NULL) {
    memcpy(newstr, str, len);
    newstr[len] = '\0';
}

@BornThisWay BornThisWay force-pushed the 1119_access_null_pointer branch from 955cf98 to 1eabf13 Compare November 20, 2022 12:07
@BornThisWay
Copy link
Contributor Author

The code has been modified. Please review the code again.

@millert millert merged commit 496ae6e into sudo-project:main Nov 20, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants