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 bug when %including folder with comment only files. #31408 #1348

Merged
merged 2 commits into from Nov 6, 2019

Conversation

Labels
None yet
Projects
None yet
4 participants
@teor2345
Copy link
Contributor

@teor2345 teor2345 commented Sep 23, 2019

When processing a %included folder, a bug caused the pointer to
the last element of the options list to be set to NULL when
processing a file with only comments or whitepace. This could
cause options from other files on the same folder to be
discarded depending on the lines after the affected %include.

When processing a %included folder, a bug caused the pointer to
the last element of the options list to be set to NULL when
processing a file with only comments or whitepace. This could
cause options from other files on the same folder to be
discarded depending on the lines after the affected %include.
@coveralls
Copy link

@coveralls coveralls commented Sep 23, 2019

Pull Request Test Coverage Report for Build 6357

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.001%) to 60.307%

Totals Coverage Status
Change from base Build 6284: 0.001%
Covered Lines: 42887
Relevant Lines: 71114

💛 - Coveralls

changes/bug31408 Outdated
@@ -0,0 +1,4 @@
o Major bugfixes (torrc):
- Stop ignoring torrc options after an %include directive, when the
included directory ends with an empty file. (Or a file only containing
Copy link
Contributor

@Jigsaw52 Jigsaw52 Sep 23, 2019

I believe empty (0 byte) files will not cause this problem. Empty files are skipped when building the list of files for a %include directive (see config_get_file_list in conffile.c) and they do not go through the buggy code. Also, the file src/test/conf_examples/include_bug_31408/included/02_empty.inc added in this commit should have some content.

Copy link
Contributor Author

@teor2345 teor2345 Sep 23, 2019

You're right, I originally had a comment in the file, but I think I dropped it when I was trying to minimise the test case. I'll fix the changes file and the test.

@torproject-pusher torproject-pusher merged commit 0614f83 into torproject:maint-0.3.5 Nov 6, 2019
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment