From 1a86fe35bb4f143d3df97950b874f9d05dc913f8 Mon Sep 17 00:00:00 2001 From: uvok cheetah Date: Sat, 14 Sep 2024 17:51:22 +0200 Subject: busybox fix: add zero termination (whoops!) --- patches/busybox/0010-lsusb-show-goddamn-descriptors.patch | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'patches') diff --git a/patches/busybox/0010-lsusb-show-goddamn-descriptors.patch b/patches/busybox/0010-lsusb-show-goddamn-descriptors.patch index 193cc4f..e937991 100644 --- a/patches/busybox/0010-lsusb-show-goddamn-descriptors.patch +++ b/patches/busybox/0010-lsusb-show-goddamn-descriptors.patch @@ -16,7 +16,7 @@ Index: busybox-1.36.1/util-linux/lsusb.c parser = config_open2(uevent_filename, fopen_for_read); free(uevent_filename); -@@ -58,10 +62,37 @@ static int FAST_FUNC fileAction(struct r +@@ -58,10 +62,39 @@ static int FAST_FUNC fileAction(struct r continue; } } @@ -29,6 +29,7 @@ Index: busybox-1.36.1/util-linux/lsusb.c + FILE* manu_file = fopen(manu_filename, "r"); + fread(manu_buf, 1, MIN(manu_stat.st_size, sizeof(manu_buf)), manu_file); + fclose(manu_file); ++ manu_buf[sizeof(manu_buf) - 1] = '\0'; + } + } + { @@ -39,6 +40,7 @@ Index: busybox-1.36.1/util-linux/lsusb.c + FILE* product_file = fopen(product_filename, "r"); + fread(product_buf, 1, MIN(product_stat.st_size, sizeof(product_buf)), product_file); + fclose(product_file); ++ product_buf[sizeof(product_buf) - 1] = '\0'; + } + } + -- cgit v1.2.3