rofi: Fix buffer overflow

This commit is contained in:
Urs Schulz 2025-01-16 11:07:41 +01:00 committed by classabbyamp
parent e714325513
commit 2e74de2eaa
2 changed files with 20 additions and 1 deletions

View file

@ -0,0 +1,19 @@
commit 246da62b9076417e0628e30099b709aa1b5cd247
Author: Urs Schulz <github@ursschulz.de>
Date: Thu Jan 16 11:05:41 2025 +0100
Fix buffer overflow in rofi -e after reading from stdin
diff --git a/source/rofi.c b/source/rofi.c
index a88cb973..58cd6873 100644
--- a/source/rofi.c
+++ b/source/rofi.c
@@ -823,6 +823,8 @@ static gboolean startup(G_GNUC_UNUSED gpointer data) {
msg = realloc(msg, length * sizeof(char));
}
+ msg[index] = 0;
+
if (!rofi_view_error_dialog(msg, markup)) {
g_main_loop_quit(main_loop);
}

View file

@ -3,7 +3,7 @@
# xlocate 'usr/lib/rofi/.*.so' to find them
pkgname=rofi
version=1.7.7
revision=1
revision=2
build_style=gnu-configure
hostmakedepends="autoconf automake flex glib-devel pkg-config which"
makedepends="libXinerama-devel librsvg-devel