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

Fix strncmp size argument in WebDav/Server.php #4

Merged
merged 1 commit into from
Jun 4, 2020

Conversation

disconnect3d
Copy link
Contributor

@disconnect3d disconnect3d commented Feb 10, 2020

This commit fixes a bug where a strncmp($key, "HTTP_CONTENT", 11) is called with an off-by-one size parameter, as the "HTTP_CONTENT" string length (without the null byte) is 12 and not 11.

There is not much impact here - if someone sends a header ContenX where X can be any char other than 'T' the program will go to the default: branch and write out that this key is not supported:

                default: 
                    // any other unknown Content-* headers
                    $this->http_status("501 not implemented"); 
                    echo "The service does not support '$key'"; 
                    return;

This commit fixes a bug where a `strncmp($key, "HTTP_CONTENT", 11)` is called with an off-by-one size parameter, as the `"HTTP_CONTENT"` string length (without the null byte) is 12 and not 11.
@CloCkWeRX CloCkWeRX merged commit 0131612 into pear:master Jun 4, 2020
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