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

[SwiftGen-L10n] Improve security when parsing format placeholders #5

Closed
AliSoftware opened this issue Jul 22, 2015 · 0 comments
Closed

Comments

@AliSoftware
Copy link
Collaborator

The algorithm for detecting %d and other %… placeholders is not very secure, in the sense that %those chars will fail will be detected as the %f placeholder + the ail string, because it starts parsing the placeholder on % and stop only when detecting one of the known type characters (d,u,i,f,@).

We probably need to stop considering that we are inside a placeholder when we encounter spaces or chars that would be invalid there. Probably check the official grammar for printf too to make that parsing stronger.

AliSoftware added a commit that referenced this issue Aug 2, 2015
…o next level by switching to NSRegularExpression and parse positional specifiers "%n$x")

+ Added associated unit tests

Fix #4, #5, #6
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