Skip to content

fixed bugs in cpf_verify #13

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

Merged
merged 1 commit into from
Dec 8, 2012

Conversation

hideaki
Copy link
Contributor

@hideaki hideaki commented Dec 8, 2012

This is fix for validation logic for CPF.

  1. check for var_len is wrong. original code would read one extra byte from the buffer if the string is not null terminated.
  2. check for strlen(s_cpf) is unnecessary and unsafe.
    It is unnecessary because checking i does the same thing, and it is unsafe because s_cpf is not guaranteed to be zeroed.
  3. check for i is wrong. It should be compared with cpf_len instead of cpf_len-1. In the original code, valid CPFs were deemed as invalid because of this.

brenosilva added a commit that referenced this pull request Dec 8, 2012
@brenosilva brenosilva merged commit adca6e4 into owasp-modsecurity:remotes/trunk Dec 8, 2012
@pbesedm pbesedm mentioned this pull request May 8, 2015
@pbesedm pbesedm mentioned this pull request Mar 12, 2016
@wergoth wergoth mentioned this pull request Jul 25, 2017
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

Successfully merging this pull request may close these issues.

2 participants