From 1876123958c3afd44becce0427755257ddf87db9 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Wed, 14 Apr 2010 14:11:37 -0400 Subject: mount.cifs: check for NULL pointer before calling strchr() mount.cifs calls strchr on currentaddress, which may be a NULL pointer. Signed-off-by: Jeff Layton --- mount.cifs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'mount.cifs.c') diff --git a/mount.cifs.c b/mount.cifs.c index acab8c8..f3aa464 100644 --- a/mount.cifs.c +++ b/mount.cifs.c @@ -1730,9 +1730,11 @@ mount_retry: case ECONNREFUSED: case EHOSTUNREACH: currentaddress = nextaddress; - nextaddress = strchr(currentaddress, ','); - if (nextaddress) - *nextaddress++ = '\0'; + if (currentaddress) { + nextaddress = strchr(currentaddress, ','); + if (nextaddress) + *nextaddress++ = '\0'; + } goto mount_retry; case ENODEV: fprintf(stderr, -- cgit v1.2.3