-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
color: Fix an assertion failure with embedded NUL bytes
Leading NUL bytes (e.g. `*\0.gz=...`) could cause us to insert a non-prefix-free set of strings into the case-insensitive extension trie, which would lead to crashes like bfs: trie_split@src/trie.c:538: Assertion failed: `key_nibble != rep_nibble` and OOB accesses to trie leaf keys. Fix it by ignoring those extensions, since filenames cannot contain NUL bytes. Fixes: 08030ae ("color: Delay the case_sensitive decision")
- Loading branch information
1 parent
9c9dc01
commit f5eaadb
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[01;34m$'rainbow/\e[1m'[0m | ||
[01;34m$'rainbow/\e[1m/'[0m$'\e[0m' | ||
[01;34mrainbow[0m | ||
[01;34mrainbow/[0m[01;31mlower.gz[0m | ||
[01;34mrainbow/[0m[01;31mlower.tar.gz[0m | ||
[01;34mrainbow/[0m[01;31mlu.tar.GZ[0m | ||
[01;34mrainbow/[0m[01;31mul.TAR.gz[0m | ||
[01;34mrainbow/[0m[01;31mupper.GZ[0m | ||
[01;34mrainbow/[0m[01;31mupper.TAR.GZ[0m | ||
[01;34mrainbow/[0m[01;32mexec.sh[0m | ||
[01;34mrainbow/[0m[01;35msocket[0m | ||
[01;34mrainbow/[0m[01;36mbroken[0m | ||
[01;34mrainbow/[0m[01;36mchardev_link[0m | ||
[01;34mrainbow/[0m[01;36mlink.txt[0m | ||
[01;34mrainbow/[0m[30;42msticky_ow[0m | ||
[01;34mrainbow/[0m[30;43msgid[0m | ||
[01;34mrainbow/[0m[33mpipe[0m | ||
[01;34mrainbow/[0m[34;42mow[0m | ||
[01;34mrainbow/[0m[37;41msugid[0m | ||
[01;34mrainbow/[0m[37;41msuid[0m | ||
[01;34mrainbow/[0m[37;44msticky[0m | ||
[01;34mrainbow/[0mfile.dat | ||
[01;34mrainbow/[0mfile.txt | ||
[01;34mrainbow/[0mlower.tar | ||
[01;34mrainbow/[0mmh1 | ||
[01;34mrainbow/[0mmh2 | ||
[01;34mrainbow/[0mupper.TAR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Regression test: embedded NUL bytes in an extension caused an assertion | ||
# failure in the trie implementation | ||
|
||
export LS_COLORS='*.gz=01;31:*\0.GZ=01;32:' | ||
bfs_diff rainbow -color |