cifs: fix potential buffer overrun when composing a new options string
authorJeff Layton <jlayton@redhat.com>
Fri, 24 May 2013 11:40:04 +0000 (07:40 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 19 Jun 2013 01:16:39 +0000 (02:16 +0100)
commit4a762b7f53a5e6bd6f6568b904ffcf2fd1811ef5
treeba84cee2c21304189f9846ce2fd1a94acaae35d5
parent71eac9d144bec44c29340b0d9905bcba3f4128e6
cifs: fix potential buffer overrun when composing a new options string

commit 166faf21bd14bc5c5295a44874bf7f3930c30b20 upstream.

Consider the case where we have a very short ip= string in the original
mount options, and when we chase a referral we end up with a very long
IPv6 address. Be sure to allow for that possibility when estimating the
size of the string to allocate.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/cifs/cifs_dfs_ref.c