File: 0001-cmdline-do-not-write-NUL-byte-to-GUI-bootstrap-scrip.patch

package info (click to toggle)
rmlint 2.9.0-2.5~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,172 kB
  • sloc: ansic: 15,100; python: 8,915; sh: 469; xml: 111; makefile: 72
file content (26 lines) | stat: -rw-r--r-- 840 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From e811a34bdf81f0f5366b07077432f8ab9c776ddd Mon Sep 17 00:00:00 2001
From: Cebtenzzre <cebtenzzre@gmail.com>
Date: Wed, 2 Aug 2023 21:29:15 -0400
Subject: cmdline: do not write NUL byte to GUI bootstrap script

Fixes #628
---
 lib/cmdline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/cmdline.c b/lib/cmdline.c
index d5b1338c..07ba104a 100644
--- a/lib/cmdline.c
+++ b/lib/cmdline.c
@@ -176,7 +176,7 @@ static void rm_cmd_start_gui(int argc, const char **argv) {
         return;
     }
 
-    if(write(bootstrap_fd, RM_PY_BOOTSTRAP, sizeof(RM_PY_BOOTSTRAP)) < 0) {
+    if(write(bootstrap_fd, RM_PY_BOOTSTRAP, strlen(RM_PY_BOOTSTRAP)) < 0) {
         rm_log_warning_line("Could not bootstrap gui: Unable to write to tempfile: %s",
                             g_strerror(errno));
         return;
-- 
2.30.2