From b21fb7f302459b9d309bbf3e2b3d46879aa8810e Mon Sep 17 00:00:00 2001 From: Mingjie Shen Date: Tue, 22 Aug 2023 01:58:23 -0400 Subject: [PATCH] [HAL] fix unbounded write in sscanf Signed-off-by: Mingjie Shen --- wrappers/os/ubuntu/HAL_OS_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrappers/os/ubuntu/HAL_OS_linux.c b/wrappers/os/ubuntu/HAL_OS_linux.c index e0ca75b80..18c41c914 100644 --- a/wrappers/os/ubuntu/HAL_OS_linux.c +++ b/wrappers/os/ubuntu/HAL_OS_linux.c @@ -278,7 +278,7 @@ char *_get_default_routing_ifname(char *ifname, int ifname_size) while (fgets(line, sizeof(line), fp)) { if (11 != - sscanf(line, "%s %08x %08x %x %d %d %d %08x %d %d %d", + sscanf(line, "%15s %08x %08x %x %d %d %d %08x %d %d %d", iface, &destination, &gateway, &flags, &refCnt, &use, &metric, &mask, &mtu, &window, &irtt)) { perror("sscanf");