Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Feb 2024 13:11:10 GMT
From:      Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= <des@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: bce34cba07bc - main - bintrans: Fix uninitialized variable.
Message-ID:  <202402011311.411DBAIR039252@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by des:

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

commit bce34cba07bcfed9cd519a658e594c9910c8f210
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2024-02-01 13:10:37 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2024-02-01 13:10:37 +0000

    bintrans: Fix uninitialized variable.
    
    `prev` may be used uninitialized if `body` starts with a newline.
    
    MFC after:      1 week
    Sponsored by:   Klara, Inc.
    Reviewed by:    bapt, emaste
    Differential Revision:  https://reviews.freebsd.org/D43534
---
 usr.bin/bintrans/qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.bin/bintrans/qp.c b/usr.bin/bintrans/qp.c
index 74fa1ec3ae90..33aabb35a101 100644
--- a/usr.bin/bintrans/qp.c
+++ b/usr.bin/bintrans/qp.c
@@ -90,9 +90,9 @@ decode_quoted_printable(const char *body, FILE *fpo)
 static void
 encode_quoted_printable(const char *body, FILE *fpo)
 {
-	char prev;
 	const char *end = body + strlen(body);
 	size_t linelen = 0;
+	char prev = '\0';
 
 	while (*body != '\0') {
 		if (linelen == 75) {



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