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

CSS Parser: skip unpaired bracket } & fix NSUInteger underflow #1045

Merged
merged 3 commits into from Feb 22, 2017

Conversation

liuslevis
Copy link
Contributor

When parsing @"s1{p1}}s2{p2}", code :

NSUInteger  braceLevel = 0;
...
braceLevel = MAX(braceLevel - 1, 0) 

will underflow, which lead to braceLevl = NSUIntegerMAX, and rest of cssString will ignore.

Trying to fix this problem.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 58.846% when pulling 01fb5c1 on SYSUDevTeam:develop into 2e5770e on Cocoanetics:develop.

@odrobnik
Copy link
Collaborator

@liuslevis could you Please also add a unit test for the fixed problem?

@liuslevis
Copy link
Contributor Author

@odrobnik a test case has been added.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 58.879% when pulling eb9bf97 on SYSUDevTeam:develop into 2e5770e on Cocoanetics:develop.

@odrobnik odrobnik merged commit 9a4f105 into Cocoanetics:develop Feb 22, 2017
@odrobnik
Copy link
Collaborator

Thank you for your contribution!

@odrobnik odrobnik self-assigned this Feb 22, 2017
@odrobnik odrobnik added the Bug label Feb 22, 2017
@odrobnik odrobnik added this to the 1.6.20 milestone Feb 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants