Skip to content

hsts: explicitly skip blank lines #13603

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

Closed

Conversation

danielgustafsson
Copy link
Member

Keep blank lines or lines containing only whitespace to make it all the way to the more expensive sscanf call in hsts_add.

lib/hsts.c Outdated
if(*lineptr == '#')
/* skip commented lines */
if((*lineptr == '#') || strlen(lineptr) == 0)
/* skip empty or commented lines */
Copy link
Member

Choose a reason for hiding this comment

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

Since Curl_get_line() works hard to return lines with a trailing newline, should this perhaps rather check for <= 1 ?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good point, it should. Rebased the PR with this fix.

Keep blank lines or lines containing only whitespace to make it all
the way to the more expensive sscanf call in hsts_add.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants