re: Segmentation fault in netstat after r354373 -> r354373 update

From: Arnaud Ysmal <a_at_stacktic.org>
Date: Thu, 07 Nov 2019 16:08:28 +0100
Hi,

I just got the same issue, it happens when argv[0] does not contain a / 
(calling uptime segfault but calling /usr/bin/uptime works).

In xo_parse_args there is no check whether cp is NULL before calling 
xo_streq.

I fixed it by changing this line:
-       cp = &cp[len + 1 - sizeof(gnu_ext)];
+       cp = (char *)(uintptr_t)(const char *)(&xo_program[len + 1 - 
sizeof(gnu_ext)]);

Arnaud Ysmal
Received on Thu Nov 07 2019 - 14:08:33 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:22 UTC