Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 May 2023 00:29:44 GMT
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: c6062b358862 - stable/13 - authpf: do not sprintf to a null pointer
Message-ID:  <202305060029.3460TiH2004363@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=c6062b3588624371feb24a52c34c8d0674f59f80

commit c6062b3588624371feb24a52c34c8d0674f59f80
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-05-03 13:26:42 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-05-06 00:29:31 +0000

    authpf: do not sprintf to a null pointer
    
    The fgetln loop will terminate with buf = NULL at EOF.
    
    Reported by:    GCC
    Reviewed by:    kp
    MFC after:      3 days
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D39947
    
    (cherry picked from commit 81f964e2ffb7cd5d30df0a5c3877900cca4fdd07)
---
 contrib/pf/authpf/authpf.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/contrib/pf/authpf/authpf.c b/contrib/pf/authpf/authpf.c
index 4032efb27895..5ffa5b9cfe43 100644
--- a/contrib/pf/authpf/authpf.c
+++ b/contrib/pf/authpf/authpf.c
@@ -566,9 +566,8 @@ allowed_luser(struct passwd *pw)
 		syslog(LOG_INFO, "denied access to %s: not listed in %s",
 		    pw->pw_name, PATH_ALLOWFILE);
 
-		/* reuse buf */
-		sprintf(buf, "%s", "\n\nSorry, you are not allowed to use this facility!\n");
-		fputs(buf, stdout);
+		fputs("\n\nSorry, you are not allowed to use this facility!\n",
+		    stdout);
 	}
 	fflush(stdout);
 	return (0);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202305060029.3460TiH2004363>