annobin/annobin-debug-dir-path-check.patch

18 lines
829 B
Diff

diff -rup orig/annocheck/annocheck.c annobin-13.28/annocheck/annocheck.c
--- orig/annocheck/annocheck.c 2026-08-11 10:59:33.981880653 +0100
+++ annobin-13.28/annocheck/annocheck.c 2026-08-11 11:00:46.525312028 +0100
@@ -730,10 +730,11 @@ extract_debug_rpm_files (void)
using_tmpdir = true;
char * cwd = getcwd (NULL, 0);
- const char * tmp = concat ("--debug-dir=", cwd, "/", tmp_debug_dir, NULL);
+#define DEBUG_DIR_OPTION "--debug-dir="
+ const char * tmp = concat (DEBUG_DIR_OPTION, cwd, "/", tmp_debug_dir, NULL);
/* This should never happen, but let's be paranoid. */
- if (! is_safe_path (tmp))
+ if (! is_safe_path (tmp + strlen (DEBUG_DIR_OPTION)))
{
afinfo (ERROR, tmp, "Path to temporary debug dir contains suspicious characters");
free ((void *) tmp_debug_dir);