Skip to content

Commit 9aa6418

Browse files
leocstonebrauner
authored andcommitted
afs: Fix check for NULL terminator
Add a missing check for reaching the end of the string while attempting to split a command. Fixes: f94f70d ("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> Link: https://lore.kernel.org/4119428.1753108152@warthog.procyon.org.uk Acked-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 Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 89be9a8 commit 9aa6418

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/afs/addr_prefs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static int afs_split_string(char **pbuf, char *strv[], unsigned int maxstrv)
4848
strv[count++] = p;
4949

5050
/* Skip over word */
51-
while (!isspace(*p))
51+
while (!isspace(*p) && *p)
5252
p++;
5353
if (!*p)
5454
break;

0 commit comments

Comments
 (0)