mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] afs: Fix check for NULL terminator
@ 2025-07-21 14:29 David Howells
  2025-07-23 11:54 ` Christian Brauner
  0 siblings, 1 reply; 2+ messages in thread
From: David Howells @ 2025-07-21 14:29 UTC (permalink / raw)
  To: Christian Brauner
  Cc: dhowells, syzbot+7741f872f3c53385a2e2, Leo Stone, Marc Dionne,
	linux-afs, linux-fsdevel, linux-kernel

From: Leo Stone <leocstone@gmail.com>
    
Add a missing check for reaching the end of the string while attempting
to split a command.

Fixes: f94f70d39cc2 ("afs: Provide a way to configure address priorities")
Reported-by: syzbot+7741f872f3c53385a2e2@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=7741f872f3c53385a2e2
Signed-off-by: Leo Stone <leocstone@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
cc: linux-fsdevel@vger.kernel.org
---
 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 c0384201b8fe..133736412c3d 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;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-23 11:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-21 14:29 [PATCH] afs: Fix check for NULL terminator David Howells
2025-07-23 11:54 ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®