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: write_graph_lgl/ncol() now refuse to write invalid files #2504

Merged
merged 2 commits into from
Feb 19, 2024

Conversation

szhorvat
Copy link
Member

This prevents the NCOL and LGL writers from creating invalid files that cannot be read back, and protects users from data loss. It also makes it easier to implement fuzzers for file format writers.

UTF-8 won't be affected as it uses >= 128 bytes for encoding higher code points.

@szhorvat szhorvat added the fuzz Issues found using fuzzing, or related to fuzzing label Feb 19, 2024
@szhorvat szhorvat requested a review from ntamas February 19, 2024 14:39
@szhorvat szhorvat marked this pull request as draft February 19, 2024 15:14
@szhorvat szhorvat force-pushed the fix/writing-invalid-lgl-ncol-files branch from 993fd66 to 91e0c80 Compare February 19, 2024 15:17
@szhorvat szhorvat marked this pull request as ready for review February 19, 2024 15:17
@szhorvat
Copy link
Member Author

I've just pushed the fuzz target I used to test this.

@ntamas ntamas merged commit 48d01bf into master Feb 19, 2024
31 checks passed
@ntamas ntamas deleted the fix/writing-invalid-lgl-ncol-files branch February 19, 2024 16:33
krlmlr added a commit to igraph/rigraph that referenced this pull request Mar 2, 2024
do not generate full scanner tables with flex
chore: improve readability of some code
refactor: igraph_degree() now uses the cache when checking for self-loops
refactor: minor readability cleanup for minimum_size_separators()
chore: add note about empty minimal st separator fix
tests: minor cleanup in regression tests
chore: update changelog
fix: correct `is_(minimal_)separator()` for disconnected graphs, fixes igraph/igraph#1480
tests: add more `is_separator()` tests
tests: fix premature memory deallocation in is_separator example
fix: igraph_all_minimal_st_separators() does not return empty separators any more, fixes igraph/igraph#2517
fix: GraphML reader does not accept duplicate attribute names any more, fixes igraph/igraph#2506
fuzzing: assertion readability in vertex separator fuzzer
fuzzing: improve vertex separator fuzzers
docs: doc improvements for ECC and Voronoi
refactor: minor prettification in trie code
fix: assert that keys in a trie are not NULL to make Coverity happy
refactor: improved error messages from C attribute handler (igraph/igraph#2513)
chore: updated changelog
fix: prevent insertion of empty keys in a trie
fix: prevent empty ID attributes for <key> tags in GraphML
docs: change mentions to pointer vectors to vector lists where appropriate & other improvements
fix: -CF causes buffer overflows with Flex, try -Cf instead
fix: bug_2506 test case should not be run if igraph is compiled without GraphML support
ci: run apt-get update in codeql-analysis pipeline
fix: fix attribute value comparison in igraph_read_graph_graphml()
fix: fix duplicate attribute detection in igraph_read_graph_graphml(), fixes igraph/igraph#2506
refactor: make use of IGRAPH_CHECK_OOM() in a few places
style: fix wording for a few warnings
refactor: more detailed error messages in C attribute handler
refactor: experimental `-Cf` option for Flex for better performance at the cost of larger code size. Hopefully this avoids fuzzer timeouts.
fix: `igraph_disjoint_union()` and `igraph_disjoint_union_many()` now check for overflow
chore: Update CONTRIBUTING.md
fuzzing: expand file format round-tripping fuzzers
fix: disallow writing invalid graph attributes to GML files, fixes igraph/igraph#2505
fuzzing: write_all fuzzer fixes
refactor: remove non-exposed igraph_maximum_matching() function whihc was already noted as removed in the 0.10 changelog
fuzzing: activate write_all fuzzer
fuzzing: add cohesive_blocks()
Merge pull request igraph/igraph#2504 from igraph/fix/writing-invalid-lgl-ncol-files
aviator-app bot pushed a commit to igraph/rigraph that referenced this pull request Mar 2, 2024
do not generate full scanner tables with flex
chore: improve readability of some code
refactor: igraph_degree() now uses the cache when checking for self-loops
refactor: minor readability cleanup for minimum_size_separators()
chore: add note about empty minimal st separator fix
tests: minor cleanup in regression tests
chore: update changelog
fix: correct `is_(minimal_)separator()` for disconnected graphs, fixes igraph/igraph#1480
tests: add more `is_separator()` tests
tests: fix premature memory deallocation in is_separator example
fix: igraph_all_minimal_st_separators() does not return empty separators any more, fixes igraph/igraph#2517
fix: GraphML reader does not accept duplicate attribute names any more, fixes igraph/igraph#2506
fuzzing: assertion readability in vertex separator fuzzer
fuzzing: improve vertex separator fuzzers
docs: doc improvements for ECC and Voronoi
refactor: minor prettification in trie code
fix: assert that keys in a trie are not NULL to make Coverity happy
refactor: improved error messages from C attribute handler (igraph/igraph#2513)
chore: updated changelog
fix: prevent insertion of empty keys in a trie
fix: prevent empty ID attributes for <key> tags in GraphML
docs: change mentions to pointer vectors to vector lists where appropriate & other improvements
fix: -CF causes buffer overflows with Flex, try -Cf instead
fix: bug_2506 test case should not be run if igraph is compiled without GraphML support
ci: run apt-get update in codeql-analysis pipeline
fix: fix attribute value comparison in igraph_read_graph_graphml()
fix: fix duplicate attribute detection in igraph_read_graph_graphml(), fixes igraph/igraph#2506
refactor: make use of IGRAPH_CHECK_OOM() in a few places
style: fix wording for a few warnings
refactor: more detailed error messages in C attribute handler
refactor: experimental `-Cf` option for Flex for better performance at the cost of larger code size. Hopefully this avoids fuzzer timeouts.
fix: `igraph_disjoint_union()` and `igraph_disjoint_union_many()` now check for overflow
chore: Update CONTRIBUTING.md
fuzzing: expand file format round-tripping fuzzers
fix: disallow writing invalid graph attributes to GML files, fixes igraph/igraph#2505
fuzzing: write_all fuzzer fixes
refactor: remove non-exposed igraph_maximum_matching() function whihc was already noted as removed in the 0.10 changelog
fuzzing: activate write_all fuzzer
fuzzing: add cohesive_blocks()
Merge pull request igraph/igraph#2504 from igraph/fix/writing-invalid-lgl-ncol-files
krlmlr added a commit to igraph/rigraph that referenced this pull request Mar 2, 2024
do not generate full scanner tables with flex
chore: improve readability of some code
refactor: igraph_degree() now uses the cache when checking for self-loops
refactor: minor readability cleanup for minimum_size_separators()
chore: add note about empty minimal st separator fix
tests: minor cleanup in regression tests
chore: update changelog
fix: correct `is_(minimal_)separator()` for disconnected graphs, fixes igraph/igraph#1480
tests: add more `is_separator()` tests
tests: fix premature memory deallocation in is_separator example
fix: igraph_all_minimal_st_separators() does not return empty separators any more, fixes igraph/igraph#2517
fix: GraphML reader does not accept duplicate attribute names any more, fixes igraph/igraph#2506
fuzzing: assertion readability in vertex separator fuzzer
fuzzing: improve vertex separator fuzzers
docs: doc improvements for ECC and Voronoi
refactor: minor prettification in trie code
fix: assert that keys in a trie are not NULL to make Coverity happy
refactor: improved error messages from C attribute handler (igraph/igraph#2513)
chore: updated changelog
fix: prevent insertion of empty keys in a trie
fix: prevent empty ID attributes for <key> tags in GraphML
docs: change mentions to pointer vectors to vector lists where appropriate & other improvements
fix: -CF causes buffer overflows with Flex, try -Cf instead
fix: bug_2506 test case should not be run if igraph is compiled without GraphML support
ci: run apt-get update in codeql-analysis pipeline
fix: fix attribute value comparison in igraph_read_graph_graphml()
fix: fix duplicate attribute detection in igraph_read_graph_graphml(), fixes igraph/igraph#2506
refactor: make use of IGRAPH_CHECK_OOM() in a few places
style: fix wording for a few warnings
refactor: more detailed error messages in C attribute handler
refactor: experimental `-Cf` option for Flex for better performance at the cost of larger code size. Hopefully this avoids fuzzer timeouts.
fix: `igraph_disjoint_union()` and `igraph_disjoint_union_many()` now check for overflow
chore: Update CONTRIBUTING.md
fuzzing: expand file format round-tripping fuzzers
fix: disallow writing invalid graph attributes to GML files, fixes igraph/igraph#2505
fuzzing: write_all fuzzer fixes
refactor: remove non-exposed igraph_maximum_matching() function whihc was already noted as removed in the 0.10 changelog
fuzzing: activate write_all fuzzer
fuzzing: add cohesive_blocks()
Merge pull request igraph/igraph#2504 from igraph/fix/writing-invalid-lgl-ncol-files
krlmlr added a commit to igraph/rigraph that referenced this pull request Mar 3, 2024
chore: update changelog
feat: igraph_is_complete() checks if a graph is complete (igraph/igraph#2510)
Merge pull request igraph/igraph#2525 from igraph/fix/linegraph-keep-loops
do not generate full scanner tables with flex
chore: improve readability of some code
refactor: igraph_degree() now uses the cache when checking for self-loops
refactor: minor readability cleanup for minimum_size_separators()
chore: add note about empty minimal st separator fix
tests: minor cleanup in regression tests
chore: update changelog
fix: correct `is_(minimal_)separator()` for disconnected graphs, fixes igraph/igraph#1480
tests: add more `is_separator()` tests
tests: fix premature memory deallocation in is_separator example
fix: igraph_all_minimal_st_separators() does not return empty separators any more, fixes igraph/igraph#2517
fix: GraphML reader does not accept duplicate attribute names any more, fixes igraph/igraph#2506
fuzzing: assertion readability in vertex separator fuzzer
fuzzing: improve vertex separator fuzzers
docs: doc improvements for ECC and Voronoi
refactor: minor prettification in trie code
fix: assert that keys in a trie are not NULL to make Coverity happy
refactor: improved error messages from C attribute handler (igraph/igraph#2513)
chore: updated changelog
fix: prevent insertion of empty keys in a trie
fix: prevent empty ID attributes for <key> tags in GraphML
docs: change mentions to pointer vectors to vector lists where appropriate & other improvements
fix: -CF causes buffer overflows with Flex, try -Cf instead
fix: bug_2506 test case should not be run if igraph is compiled without GraphML support
ci: run apt-get update in codeql-analysis pipeline
fix: fix attribute value comparison in igraph_read_graph_graphml()
fix: fix duplicate attribute detection in igraph_read_graph_graphml(), fixes igraph/igraph#2506
refactor: make use of IGRAPH_CHECK_OOM() in a few places
style: fix wording for a few warnings
refactor: more detailed error messages in C attribute handler
refactor: experimental `-Cf` option for Flex for better performance at the cost of larger code size. Hopefully this avoids fuzzer timeouts.
fix: `igraph_disjoint_union()` and `igraph_disjoint_union_many()` now check for overflow
chore: Update CONTRIBUTING.md
fuzzing: expand file format round-tripping fuzzers
fix: disallow writing invalid graph attributes to GML files, fixes igraph/igraph#2505
fuzzing: write_all fuzzer fixes
refactor: remove non-exposed igraph_maximum_matching() function whihc was already noted as removed in the 0.10 changelog
fuzzing: activate write_all fuzzer
fuzzing: add cohesive_blocks()
Merge pull request igraph/igraph#2504 from igraph/fix/writing-invalid-lgl-ncol-files
docs: document that `write_graph_graphml()` assumes that strings are UTF-8 encoded, fixes igraph/igraph#2503
docs: mention that the variation of information is in natural units
krlmlr added a commit to igraph/rigraph that referenced this pull request Mar 3, 2024
chore: update changelog
feat: igraph_is_complete() checks if a graph is complete (igraph/igraph#2510)
Merge pull request igraph/igraph#2525 from igraph/fix/linegraph-keep-loops
do not generate full scanner tables with flex
chore: improve readability of some code
refactor: igraph_degree() now uses the cache when checking for self-loops
refactor: minor readability cleanup for minimum_size_separators()
chore: add note about empty minimal st separator fix
tests: minor cleanup in regression tests
chore: update changelog
fix: correct `is_(minimal_)separator()` for disconnected graphs, fixes igraph/igraph#1480
tests: add more `is_separator()` tests
tests: fix premature memory deallocation in is_separator example
fix: igraph_all_minimal_st_separators() does not return empty separators any more, fixes igraph/igraph#2517
fix: GraphML reader does not accept duplicate attribute names any more, fixes igraph/igraph#2506
fuzzing: assertion readability in vertex separator fuzzer
fuzzing: improve vertex separator fuzzers
docs: doc improvements for ECC and Voronoi
refactor: minor prettification in trie code
fix: assert that keys in a trie are not NULL to make Coverity happy
refactor: improved error messages from C attribute handler (igraph/igraph#2513)
chore: updated changelog
fix: prevent insertion of empty keys in a trie
fix: prevent empty ID attributes for <key> tags in GraphML
docs: change mentions to pointer vectors to vector lists where appropriate & other improvements
fix: -CF causes buffer overflows with Flex, try -Cf instead
fix: bug_2506 test case should not be run if igraph is compiled without GraphML support
ci: run apt-get update in codeql-analysis pipeline
fix: fix attribute value comparison in igraph_read_graph_graphml()
fix: fix duplicate attribute detection in igraph_read_graph_graphml(), fixes igraph/igraph#2506
refactor: make use of IGRAPH_CHECK_OOM() in a few places
style: fix wording for a few warnings
refactor: more detailed error messages in C attribute handler
refactor: experimental `-Cf` option for Flex for better performance at the cost of larger code size. Hopefully this avoids fuzzer timeouts.
fix: `igraph_disjoint_union()` and `igraph_disjoint_union_many()` now check for overflow
chore: Update CONTRIBUTING.md
fuzzing: expand file format round-tripping fuzzers
fix: disallow writing invalid graph attributes to GML files, fixes igraph/igraph#2505
fuzzing: write_all fuzzer fixes
refactor: remove non-exposed igraph_maximum_matching() function whihc was already noted as removed in the 0.10 changelog
fuzzing: activate write_all fuzzer
fuzzing: add cohesive_blocks()
Merge pull request igraph/igraph#2504 from igraph/fix/writing-invalid-lgl-ncol-files
docs: document that `write_graph_graphml()` assumes that strings are UTF-8 encoded, fixes igraph/igraph#2503
docs: mention that the variation of information is in natural units
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fuzz Issues found using fuzzing, or related to fuzzing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants