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

Protect against server hijacking error handling #7811

Merged
merged 3 commits into from
Jan 8, 2021
Merged

Protect against server hijacking error handling #7811

merged 3 commits into from
Jan 8, 2021

Conversation

paulocsanz
Copy link
Contributor

If a server returns "HTTP/1.x -8 OK", for example, it can misguide an application developer into freeing less-important memory so the request can be retried and succeed, when the problem is in the server.

_returnCode is never used anywhere else, but it could still contain a negative value returned by a broken server and therefore could cause troubles in the future (if _returnCode is in fact used)

If a server returns "HTTP/1.x -8 OK", for example, it can misguide an application developer into freeing less-important memory so the request can be retried and succeed, when the problem is in the server.

_returnCode is never used anywhere else, but it could still contain a negative value returned by a broken server and therefore could cause troubles in the future (if _returnCode is in fact used)
Copy link
Collaborator

@earlephilhower earlephilhower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you actually seen HTTP servers so far out of spec that they really return negative error codes?

Minor style change, please. OTW seems fine.

libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp Outdated Show resolved Hide resolved
@paulocsanz
Copy link
Contributor Author

No, I've not. It's probably not a big deal. It was just something I caught in a code "audit".

Copy link
Collaborator

@earlephilhower earlephilhower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM.

@earlephilhower earlephilhower merged commit 98a19ab into esp8266:master Jan 8, 2021
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