* [PATCH] autofs-5.1.9: fix buffer overflow in macro_parse_globalvar()
@ 2024-04-17 13:40 Victoria Egorova
0 siblings, 0 replies; only message in thread
From: Victoria Egorova @ 2024-04-17 13:40 UTC (permalink / raw)
To: autofs; +Cc: Victoria Egorova
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-04-17 13:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-17 13:40 [PATCH] autofs-5.1.9: fix buffer overflow in macro_parse_globalvar() Victoria Egorova
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.