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

Possible defect in source code (CWE-570) #5685

Closed
AppChecker opened this issue Mar 9, 2017 · 1 comment
Closed

Possible defect in source code (CWE-570) #5685

AppChecker opened this issue Mar 9, 2017 · 1 comment

Comments

@AppChecker
Copy link

Hello!

We've checked your code with AppChecker static analyzer and found possible bug:

else if ($str[$position] == "\r" && $str[$position] == "\n") {

else  if ($str[$position] == "\r" && $str[$position] == "\n") {
                            $position += 2;
                        }

$str[$position] can't be equal to "\r" and "\n" at the same time.

if ($str[$position] == "\n") is checked earlier so we think that code should be like:

else  if ($str[$position] == "\r" && $str[$position + 1] == "\n") {
                            $position += 2;
                        }

Possible defect was found by Echelon Team with AppChecker static analyzer

@alecpl
Copy link
Member

alecpl commented Mar 9, 2017

Thanks. Fixed.

@alecpl alecpl closed this as completed Mar 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants