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

Catch a possible null-dereference #8508

Merged
merged 1 commit into from
Mar 13, 2022
Merged

Catch a possible null-dereference #8508

merged 1 commit into from
Mar 13, 2022

Conversation

einglis
Copy link
Contributor

@einglis einglis commented Mar 11, 2022

In testing, I had an HTTP server that would server a 200 OK header, then crash, killing the connection.

The result was an exception in HTTPUpdater, which turned out to be due to passing a null pointer to WiFiClient::stopAllExcept

In catching this, I've chosen to return HTTPC_ERROR_CONNECTION_LOST. This is an HTTPClient definition, rather than an HTTPUpdate one, which makes me a little uneasy. I've justified it to myself on the basis that:

  1. There is no pre-existing HTTPUpdate value that seems appropriate, and
  2. The ones that are defined are preceded by the comment: /// note we use HTTP client errors too [...]

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!

@d-a-v d-a-v merged commit 732db59 into esp8266:master Mar 13, 2022
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.

None yet

3 participants