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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
---
 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





[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux