Problem: xxd: cannot use -b and -i together
(Irgendwer)
Solution: implement the missing changes
(Andre Chang)
fixes: #15362closes: #15661
Signed-off-by: Andre Chang <andre@augmentcode.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: style issues with man pages
Solution: update man pages and test_xxd.vim, since it uses
the xxd man page (RestorerZ)
closes: #15489
Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: [security] xxd: buffer-overflow with specific flags
Solution: Correctly calculate the required buffer space
(Lennard Hofmann)
xxd writes each output line into a global buffer before printing.
The maximum size of that buffer was not calculated correctly.
This command was crashing in AddressSanitizer:
$ xxd -Ralways -g1 -c256 -d -o 9223372036854775808 /etc/passwd
This prints a line of 6680 bytes but the buffer only had room for 6549 bytes.
If the output from "-b" was colored, the line could be even longer.
closes: #14738
Co-authored-by: K.Takata <kentkt@csc.jp>
Signed-off-by: Lennard Hofmann <lennard.hofmann@web.de>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: xxd: cannot reverse a bit dump
Solution: implement reversing the bit dump using -b -r
closes: #13286
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: tristhaus <tristhaus@yahoo.de>
Commit f6fc255e8d (v9.0.1834) updated xxd.1 but the xxd.man
page wasn't re-generated. So let's just regenerate it now.
Signed-off-by: Christian Brabandt <cb@256bit.org>