[PATCH] netstat: Escape program names before printing
Anton Skorup
antonsk at axis.com
Mon Jul 13 06:19:58 UTC 2026
From: Anton Skorup <anton at skorup.se>
Signed-off-by: Anton Skroup <anton.skorup at axis.com>
---
networking/netstat.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/networking/netstat.c b/networking/netstat.c
index d31928957..d21a3995c 100644
--- a/networking/netstat.c
+++ b/networking/netstat.c
@@ -471,7 +471,7 @@ static void print_inet_line(struct inet_params *param,
state_str);
#if ENABLE_FEATURE_NETSTAT_PRG
if (option_mask32 & OPT_prg)
- printf("%."PROGNAME_WIDTH_STR"s", prg_cache_get(param->inode));
+ printf("%."PROGNAME_WIDTH_STR"s", printable_string(prg_cache_get(param->inode)));
#endif
bb_putchar('\n');
free(l);
@@ -645,7 +645,7 @@ static int FAST_FUNC unix_do_one(char *line)
#if ENABLE_FEATURE_NETSTAT_PRG
if (option_mask32 & OPT_prg)
- printf("%-"PROGNAME_WIDTH_STR"s", prg_cache_get(inode));
+ printf("%-"PROGNAME_WIDTH_STR"s", printable_string(prg_cache_get(inode)));
#endif
/* TODO: currently we stop at first NUL byte. Is it a problem? */
--
2.43.0
More information about the busybox
mailing list