Source: nn
Version: 6.7.3-14
Severity: normal
Tags: patch

Dear Maintainer,

>From 09426e21f08502654275884fc0e148bb427565d7 Mon Sep 17 00:00:00 2001
>From: Bjarni Ingi Gislason <bjarn...@rhi.hi.is>
>Date: Sun, 28 Feb 2021 22:22:44 +0000
>Subject: [PATCH] dir.c: use "snprintf()" instead of "sprintf()"

  dir.c: use "snprintf()" instead of "sprintf()".

Signed-off-by: Bjarni Ingi Gislason <bjarn...@rhi.hi.is>
---
 dir.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dir.c b/dir.c
index a174c87..f8f1a28 100644
--- a/dir.c
+++ b/dir.c
@@ -144,9 +144,9 @@ int
 list_directory(char *dir, char *prefix)
 {
     if (prefix[0])
-       sprintf(dir_path, "cd %s && echo %s* 2>/dev/null", dir, prefix);
+       snprintf(dir_path, FILENAME, "cd %s && echo %s* 2>/dev/null", dir, 
prefix);
     else
-       sprintf(dir_path, "cd %s && ls 2>/dev/null", dir);
+       snprintf(dir_path, FILENAME, "cd %s && ls 2>/dev/null", dir);
     prefix_lgt = strlen(prefix);
 
     if ((dirf = popen(dir_path, "r")) == NULL)
-- 
2.30.1



-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.9-1 (SMP w/2 CPU threads)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), 
LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

-- debconf information excluded

-- 
Bjarni I. Gislason

Reply via email to