]> git.proxmox.com Git - mirror_iproute2.git/commit
color: Fix another ip segfault when using --color switch
authorPetr Vorel <petr.vorel@gmail.com>
Fri, 13 Oct 2017 13:57:17 +0000 (15:57 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 16 Oct 2017 16:24:11 +0000 (09:24 -0700)
commit24b058a2a4f5248becc3c148637a3644d11a65a9
tree517ed3b6cd2d4526f06a400fa5af43e14edcde64
parente6849a5722dc248a1fe0519c97094000ded3849c
color: Fix another ip segfault when using --color switch

Commit 959f1428 ("color: add new COLOR_NONE and disable_color function")
introducing color enum COLOR_NONE, which is not only duplicite of
COLOR_CLEAR, but also caused segfault, when running ip with --color
switch, as 'attr + 8' in color_fprintf() access array item out of
bounds. Thus removing it and restoring "magic" offset + 7.

Reproduce with:
$ ip -c a

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
include/color.h
lib/color.c