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

Array access result in null pointer dereference. #16

Open
mkpatil opened this issue Feb 4, 2013 · 4 comments
Open

Array access result in null pointer dereference. #16

mkpatil opened this issue Feb 4, 2013 · 4 comments

Comments

@mkpatil
Copy link

mkpatil commented Feb 4, 2013

After upgrading XCode to 4.6, I got above analyze warnings.
Screen Shot 2013-02-04 at 7 22 28 PM
Screen Shot 2013-02-04 at 7 22 18 PM
Screen Shot 2013-02-04 at 7 22 42 PM

@mkpatil
Copy link
Author

mkpatil commented Feb 5, 2013

@Tpbradley Please help me on above issue.

@Tpbradley
Copy link

I've had a quick look and it looks like xcode is showing errors because there is a potential that some variables could be set to nil and accessed further on in the code. For example, in the code just above, currTBXMLElement could be set to nil, yet it's accessed layer on by currTBXMLElement->nextSibling.

The fix is to simply check currTBXMLElement contains a value before using it. The other errors look to be the same problem.

@mkpatil
Copy link
Author

mkpatil commented Feb 6, 2013

@Tpbradley I tried few code snippet as per your suggestion but it didn't work. I think something goes wrong, I just want to know that when can we expect this update or commit so that we can upgrade TBXML library as early as possible with this new fix.

@Greensource
Copy link

Hi,
you must first check nullity of 'bytes'. I wrote that to fix warning:
"if (bytes) bytes[bytesLength] = 0;"

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

3 participants