unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob b499a039e8a638215cf4b2a5ca47911d007bc094 945 bytes (raw)
name: packages/patches/xdg-desktop-portal-wlr-harcoded-length.patch 	 # note: path name is non-authoritative(*)

 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
27
28
 
From 3121eeb5e68bedd6e2398f35b9bd60b69709a47e Mon Sep 17 00:00:00 2001
From: Josselin Poiret <dev@jpoiret.xyz>
Date: Tue, 14 Dec 2021 18:49:54 +0100
Subject: [PATCH] Replace hardcoded command length

---
 src/screenshot/screenshot.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/screenshot/screenshot.c b/src/screenshot/screenshot.c
index 9df0ea7..5f27681 100644
--- a/src/screenshot/screenshot.c
+++ b/src/screenshot/screenshot.c
@@ -42,8 +42,9 @@ static bool exec_screenshooter_interactive(const char *path) {
 		perror("fork");
 		return false;
 	} else if (pid == 0) {
-		char cmd[strlen(path) + 25];
-		snprintf(cmd, sizeof(cmd), "grim -g \"$(slurp)\" -- %s", path);
+		const char cmd_fmt[] = "grim -g \"$(slurp)\" -- %s";
+		char cmd[strlen(path) + sizeof(cmd_fmt)];
+		snprintf(cmd, sizeof(cmd), cmd_fmt, path);
 		execl("/bin/sh", "/bin/sh", "-c", cmd, NULL);
 		perror("execl");
 		exit(127);
-- 
2.34.0


debug log:

solving b499a039e8a638215cf4b2a5ca47911d007bc094 ...
found b499a039e8a638215cf4b2a5ca47911d007bc094 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).