autofs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Victoria Egorova <vegorova@astralinux.ru>
To: autofs@vger.kernel.org
Cc: Victoria Egorova <vegorova@astralinux.ru>
Subject: [PATCH] autofs-5.1.9: fix buffer overflow in macro_parse_globalvar()
Date: Wed, 17 Apr 2024 16:40:39 +0300	[thread overview]
Message-ID: <20240417134039.29936-1-vegorova@astralinux.ru> (raw)

Stack-buffer-overflow was detected in macros.c with AFLplusplus. 
Fix the loop condition in the lib/marcos.c:macro_parse_globalvar() 
to ensure it checks for a pointer value instead of an address.

Signed-off-by: Victoria Egorova <vegorova@astralinux.ru>
---
 lib/macros.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/macros.c b/lib/macros.c
index 5def26d..082481a 100644
--- a/lib/macros.c
+++ b/lib/macros.c
@@ -240,7 +240,7 @@ int macro_parse_globalvar(const char *define)
 	strcpy(buf, define);
 
 	pbuf = buf;
-	while (pbuf) {
+	while (*pbuf) {
 		if (*pbuf == '=') {
 			*pbuf = '\0';
 			value = pbuf + 1;
-- 
2.39.2


                 reply	other threads:[~2024-04-17 13:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240417134039.29936-1-vegorova@astralinux.ru \
    --to=vegorova@astralinux.ru \
    --cc=autofs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).