[PATCH] autofs-5.1.9: fix buffer overflow in macro_parse_globalvar()

Victoria Egorova <[email protected]>
Newsgroups org.kernel.vger.autofs
Message-ID <[email protected]>
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 <[email protected]>
---
 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.