mirror of
https://github.com/vim/vim.git
synced 2025-11-15 23:14:06 -05:00
Problem: xxd: Avoid null dereference in autoskip colorless
Solution: Verify that colors is not null (Joakim Nohlgård)
Fixes bug introduced in 6897f18ee6
(v9.1.1459) which does a memcpy from NULL when color=never and the
autoskip option is used.
Before:
dd if=/dev/zero bs=100 count=1 status=none | xxd -a -R never
00000000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
Segmentation fault (core dumped)
After:
dd if=/dev/zero bs=100 count=1 status=none | ./xxd/xxd -a -R never
00000000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
00000060: 0000 0000 ....
closes: #18008
Signed-off-by: Joakim Nohlgård <joakim@nohlgard.se>
Signed-off-by: Christian Brabandt <cb@256bit.org>