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 use-after-free when using custom ntp server #287

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

os04
Copy link
Contributor

@os04 os04 commented Jul 24, 2024

This also fixes issue #264

Tested on my OpenSprinkler 3

Issue:

OpenSprinkler likes to periodically lookup gibberish DNS names when a custom NTP server has been configured. This lookup is often correlated with lookups of time.google.com and time.nist.gov, and the configured NTP server stops being queried when this starts to happen. Exact issue presentation can vary based on how some of the other settings are configured.

Cause:

It seems that configTime() requires its strings to be accessible after the function call is finished.

Fix:

Allocate a static buffer for the NTP server IP address string.

@arfrie22
Copy link
Contributor

Thank you for catching this.

@arfrie22 arfrie22 merged commit d2d7828 into OpenSprinkler:master Jul 24, 2024
5 checks passed
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