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

Buffer out of bounds access through pointer in rapidxml [ASAN] #443

Open
stevetranby opened this issue May 19, 2022 · 1 comment
Open

Buffer out of bounds access through pointer in rapidxml [ASAN] #443

stevetranby opened this issue May 19, 2022 · 1 comment

Comments

@stevetranby
Copy link

stevetranby commented May 19, 2022

I'm not sure if there's an issue for this, but the check if beyond end of string should be tested before dereferencing the pointer to the buffer.

if (*text == 0 || text >= endptr_)

e.g. (should check if gone past end first, otherwise check if it points to a null terminator \0 character):

//if (*text == 0 || text >= endptr_)
if (text >= endptr_ || *text == 0)
                    break;
@dumganhar
Copy link

Yep, I think it should check whether the text pointer is valid first. Otherwise, it will read an invalid byte.

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

No branches or pull requests

2 participants