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

Dear Maintainer,

>From c96c7b634c1024e3cebd0000ad7d66575f0ed16d Mon Sep 17 00:00:00 2001
>From: Bjarni Ingi Gislason <bjarn...@rhi.hi.is>
>Date: Mon, 15 Mar 2021 01:01:21 +0000
>Subject: [PATCH] aux.c: use "snprintf()" instead of "sprintf()"

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

diff --git a/aux.c b/aux.c
index 0a35174..f5c3a87 100644
--- a/aux.c
+++ b/aux.c
@@ -616,7 +616,7 @@ aux.c:...: warning: the address of 'fname' will always 
evaluate as 'true'
                    temp_file, final);
            system(buf);
            if (mailer_pipe_input) {
-               sprintf(buf, "%s < %s", mailer_program, final);
+               snprintf(buf, NBUF, "%s < %s", mailer_program, final);
                x = system(buf);
            } else {
                strncpy(buf, mailer_program, 50);
@@ -683,7 +683,7 @@ aux.c:...: warning: the address of 'fname' will always 
evaluate as 'true'
            fprintf(rec, "From %s %s", logname, ctime(&t));
            fprintf(rec, "From: %s\n", logname);
            fclose(rec);
-           sprintf(buf, "cat %s >> %s", temp_file, record);
+           snprintf(buf, NBUF, "cat %s >> %s", temp_file, record);
            system(buf);
        }
     }
-- 
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.19-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