Wednesday, May 31, 2023

Re: netstat: vfprintf %s NULL in " %2d %-5.16s"

On 2023-05-31, Benjamin Stürz <benni+openbsd@stuerz.xyz> wrote:
> Hi misc@,
>
> while scrolling through my /var/log/messages I found this entry:
> netstat: vfprintf %s NULL in " %2d %-5.16s"
>
> I tracked down the issue to line 278 of /usr/src/usr.bin/netstat/show.c:
>> printf(" %2d %-5.16s", rtm->rtm_priority,
>> if_indextoname(rtm->rtm_index, ifbuf))
> It appears to me that if_indextoname(3) returns NULL for some reason,
> and that this isn't being checked.
>
> Is this intentional? Or did I find a minor bug?

I'd guess at a race, probably the route was pointing at a virtual
interface that was removed during printing of the route table.

No comments:

Post a Comment