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

scan-build report "Dereference of null pointer" for function wildcmp #124

Closed
cyyever opened this issue Apr 12, 2018 · 1 comment
Closed

Comments

@cyyever
Copy link
Contributor

cyyever commented Apr 12, 2018

The detail analysis is in my uploaded screenshot image. I think this is not a false positive,please check it .
screenshot from 2018-04-12 14-52-43

@onqtam
Copy link
Member

onqtam commented Apr 30, 2018

Well that function is basically taken from here - its been around for almost 20 years and I don't see reports of crashes/null derefs.

I also tried to come up with a scenario where it would fail but couldn't - traced the logic a bunch of times.

I think what the analyzer thinks is that we can get to str = cp++; without ever having gotten to initializing it (cp = str + 1;) but I don't think that is possible.

So I'm closing this as a false positive - until someone comes up with a test case where this crashes.

@onqtam onqtam closed this as completed Apr 30, 2018
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