summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Dickson <steved@redhat.com>2009-02-17 15:33:58 -0500
committerSteve Dickson <steved@redhat.com>2009-02-17 15:33:58 -0500
commit52ec1b5fceece8f63b97afc6d6b78bfabff12669 (patch)
tree9d9f8202c62fc68c17cabde2ec0b655306b34748
parente7ec5e745e851ad10c56d579463ee7e1b85c9c21 (diff)
downloadnfs-utils-52ec1b5fceece8f63b97afc6d6b78bfabff12669.tar.gz
nfs-utils-52ec1b5fceece8f63b97afc6d6b78bfabff12669.tar.xz
nfs-utils-52ec1b5fceece8f63b97afc6d6b78bfabff12669.zip
The mount sockaddr len (mnt_salen) is not be set in
nfs_extract_server_addresses() which causes the mount.nfs command to segmentation fault when a NFS server only supports UDP mounts. Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--utils/mount/stropts.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index 770b5b5..c369136 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -331,9 +331,10 @@ static int nfs_extract_server_addresses(struct mount_options *options,
return 0;
option = po_get(options, "mountaddr");
- if (option == NULL)
+ if (option == NULL) {
memcpy(mnt_saddr, nfs_saddr, *nfs_salen);
- else if (!nfs_string_to_sockaddr(option, strlen(option),
+ *mnt_salen = *nfs_salen;
+ } else if (!nfs_string_to_sockaddr(option, strlen(option),
mnt_saddr, mnt_salen))
return 0;