Revision 33b9e70f7ceea28eda07aa2e638f758acacd7032 authored by Tobias Klauser on 30 November 2021, 12:08:22 UTC, committed by Nathan Sweet on 02 December 2021, 23:08:48 UTC
[ upstream commit e38e3c44f712b5f0ecf33efd1867c0ae16b241f7 ]

Commit 8bcc4e5dd830 ("bugtool: avoid allocation on conversion of
execCommand result to string") broke the `ip route show` commands
because the change from `[]byte` to `string` causes the `%v` formatting
verb to emit the raw byte slice, not the string. Fix this by using the
`%s` formatting verb to make sure the argument gets interpreted as a
string.

Also fix another instance in `writeCmdToFile` where `fmt.Fprint` is now
invoked with a byte slice.

Grepping for `%v` in bugtool sources and manually inspecting all changes
from commit 8bcc4e5dd830 showed no other instances where a byte slice
could potentially end up being formatted in a wrong way.

Fixes: 8bcc4e5dd830 ("bugtool: avoid allocation on conversion of execCommand result to string")

Signed-off-by: Tobias Klauser <tobias@cilium.io>
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
1 parent b51a044
History

back to top