diff options
author | Jeff Layton <jlayton@samba.org> | 2010-04-14 14:11:37 -0400 |
---|---|---|
committer | Jeff Layton <jlayton@samba.org> | 2010-04-14 14:11:37 -0400 |
commit | 1876123958c3afd44becce0427755257ddf87db9 (patch) | |
tree | 0d6a20834da97bcd0903c3acb803d7d432335fb2 /mount.cifs.c | |
parent | 9eb040343a5917c08c80d43ef3123d796f88bf6e (diff) | |
download | cifs-utils-1876123958c3afd44becce0427755257ddf87db9.tar.gz cifs-utils-1876123958c3afd44becce0427755257ddf87db9.tar.bz2 cifs-utils-1876123958c3afd44becce0427755257ddf87db9.zip |
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 <jlayton@samba.org>
Diffstat (limited to 'mount.cifs.c')
-rw-r--r-- | mount.cifs.c | 8 |
1 files changed, 5 insertions, 3 deletions
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, |