mount.cifs: have parse_options fill parsed_mount_info
authorJeff Layton <jlayton@redhat.com>
Thu, 1 Apr 2010 19:19:16 +0000 (15:19 -0400)
committerJeff Layton <jlayton@redhat.com>
Thu, 1 Apr 2010 19:19:16 +0000 (15:19 -0400)
commitc9b5372277c3ab046d09508d90c1c3f8137b3a11
tree0be4b9988dc4aea3acccf2939632cb40a2c49f8e
parentbda33540ab300dd9a996580d9f60ef3527490833
mount.cifs: have parse_options fill parsed_mount_info

Allocate a zeroed out parsed_mount_info struct and have parse_options
put its info into that instead. realloc() is no longer used here and
instead we just have the option parser carefully check that the result
will fit in the buffer before copying it.

We also no longer use snprintf to stuff info directly into the buffer.
It may not be possible given the other checks, but snprintf can leave a
non-NULL terminated string. Use strlcat everywhere instead to ensure
that doesn't occur.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
mount.cifs.c