Fix a crash where Catch was dereferencing a NULL string. #159

Closed
wants to merge 6 commits into
from

Conversation

Projects
None yet
2 participants
@iamleeg
Contributor

iamleeg commented Mar 12, 2013

This line was crashing:

    REQUIRE(testObject.concreteProperty == (id)nil);

where concreteProperty is a property of type NSString*. I discovered that CATCH was choosing the toString(NSString *nsstring) overload rather than the toString(nullptr_t) overload. The crash was in std::string::operator+() trying to find the length of the NULL string [NSString UTF8String].

I would have included a test demonstrating my change but it appears that SelfTest doesn't support ObjC++…

@iamleeg

This comment has been minimized.

Show comment Hide comment
@iamleeg

iamleeg Mar 12, 2013

Contributor

Sorry, had a failure moment and created the change against the wrong version. Commit #28717bf is the required fix.

Contributor

iamleeg commented Mar 12, 2013

Sorry, had a failure moment and created the change against the wrong version. Commit #28717bf is the required fix.

philsquared added a commit that referenced this pull request Mar 12, 2013

@philsquared

This comment has been minimized.

Show comment Hide comment
@philsquared

philsquared Mar 12, 2013

Collaborator

Thanks, Graham.

I couldn't merge the changes cleanly so I just reapplied them (on integration). I hope that doesn't cause problems for you rebasing.
I added a test in the OCTest project. (It's not quite as structured as the self test project, but it's something).

Collaborator

philsquared commented Mar 12, 2013

Thanks, Graham.

I couldn't merge the changes cleanly so I just reapplied them (on integration). I hope that doesn't cause problems for you rebasing.
I added a test in the OCTest project. (It's not quite as structured as the self test project, but it's something).

@philsquared

This comment has been minimized.

Show comment Hide comment
@philsquared

philsquared Apr 5, 2013

Collaborator

I presume you're all good, Graham? Can I close this one now?

Collaborator

philsquared commented Apr 5, 2013

I presume you're all good, Graham? Can I close this one now?

@philsquared

This comment has been minimized.

Show comment Hide comment
@philsquared

philsquared Apr 8, 2013

Collaborator

Closing anyway - please re-open if necessary

Collaborator

philsquared commented Apr 8, 2013

Closing anyway - please re-open if necessary

@philsquared philsquared closed this Apr 8, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment