File xrdp-CVE-2022-23468.patch of Package xrdp.37241

From 2965a1a59ec5d509f8720a274f5242965b91a299 Mon Sep 17 00:00:00 2001
From: matt335672 <30179339+matt335672@users.noreply.github.com>
Date: Wed, 7 Dec 2022 09:16:44 +0000
Subject: [PATCH 02/10] CVE-2022-23468

Login window - replace g_sprintf() withl g_snprintf() calls
---
 xrdp/xrdp_login_wnd.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/xrdp/xrdp_login_wnd.c b/xrdp/xrdp_login_wnd.c
index c09f8002..839b35af 100644
--- a/xrdp/xrdp_login_wnd.c
+++ b/xrdp/xrdp_login_wnd.c
@@ -709,15 +709,15 @@ xrdp_login_wnd_create(struct xrdp_wm *self)
     /* if window title not specified, use hostname as default */
     if (globals->ls_title[0] == 0)
     {
-       g_gethostname(buf1, 256);
-       g_sprintf(buf, "Login to %s", buf1);
-       set_string(&self->login_window->caption1, buf);
+        g_gethostname(buf1, 256);
+        g_snprintf(buf, sizeof(buf), "Login to %s", buf1);
+        set_string(&self->login_window->caption1, buf);
     }
     else
     {
-       /*self->login_window->caption1 = globals->ls_title[0];*/
-       g_sprintf(buf, "%s", globals->ls_title);
-       set_string(&self->login_window->caption1, buf);
+        /*self->login_window->caption1 = globals->ls_title[0];*/
+        g_snprintf(buf, sizeof(buf), "%s", globals->ls_title);
+        set_string(&self->login_window->caption1, buf);
     }
 
     if (regular)
-- 
2.39.0

openSUSE Build Service is sponsored by