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 buffer overflow in uri parsing #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

morf
Copy link
Contributor

@morf morf commented Jul 5, 2024

Resolved a buffer overflow bug in ngx_http_graphite_location() when parsing uri entirely made up of underscores. The loop incorrectly traverses past the buffer's boundary:

while (split->len > 0 && split->data[0] == '_') {
split->data++;
split->len--;
}

Later, it writes a '_' character outside of the buffer:

if (split->len == 0) {
split->data[split->len++] = '_';
}

This problem occurs with the uri: "/".

Resolved a buffer overflow bug in ngx_http_graphite_location() when parsing uri entirely made up of underscores. The loop incorrectly traverses past the buffer's boundary:

while (split->len > 0 && split->data[0] == '_') {
    split->data++;
    split->len--;
}

Later, it writes a '_' character outside of the buffer:

if (split->len == 0) {
    split->data[split->len++] = '_';
}

This problem occurs with the uri: "/".
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.

1 participant