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

Invalid check when moving line #2

Open
oerdnj opened this issue May 3, 2021 · 0 comments
Open

Invalid check when moving line #2

oerdnj opened this issue May 3, 2021 · 0 comments

Comments

@oerdnj
Copy link

oerdnj commented May 3, 2021

Hey,

I believe the check here: https://github.com/conformal/backtrace/blob/master/libbacktrace/backtrace.c#L264

should in fact be:

if (csz >= sz - (current - (char *)rv)) {
...
}

Currently, as written, the condition can't ever be true because strlcpy() unless line[x] was not properly NULL terminated (e.g. runaway string), but you probably wanted to check if strlcpy() was able to fit the whole line[i] inside the cur buffer.

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

1 participant