[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241217191051.77935-2-leocstone@gmail.com>
Date: Tue, 17 Dec 2024 11:10:52 -0800
From: Leo Stone <leocstone@...il.com>
To: syzbot+7741f872f3c53385a2e2@...kaller.appspotmail.com
Cc: dhowells@...hat.com,
linux-afs@...ts.infradead.org,
linux-kernel@...r.kernel.org,
marc.dionne@...istor.com,
syzkaller-bugs@...glegroups.com,
Leo Stone <leocstone@...il.com>
Subject: [PATCH] afs: check for NULL terminator
Add a missing check for reaching the end of the string while attempting
to split a command.
Reported-by: syzbot+7741f872f3c53385a2e2@...kaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=7741f872f3c53385a2e2
Signed-off-by: Leo Stone <leocstone@...il.com>
---
fs/afs/addr_prefs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/afs/addr_prefs.c b/fs/afs/addr_prefs.c
index a189ff8a5034..4f8553aa5931 100644
--- a/fs/afs/addr_prefs.c
+++ b/fs/afs/addr_prefs.c
@@ -48,7 +48,7 @@ static int afs_split_string(char **pbuf, char *strv[], unsigned int maxstrv)
strv[count++] = p;
/* Skip over word */
- while (!isspace(*p))
+ while (!isspace(*p) && *p)
p++;
if (!*p)
break;
--
2.43.0
Powered by blists - more mailing lists