]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
The mount sockaddr len (mnt_salen) is not be set in
authorSteve Dickson <steved@redhat.com>
Tue, 17 Feb 2009 20:33:58 +0000 (15:33 -0500)
committerSteve Dickson <steved@redhat.com>
Tue, 17 Feb 2009 20:33:58 +0000 (15:33 -0500)
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>
utils/mount/stropts.c

index 770b5b515c494d135966497ad27ba7c73ccea7c8..c369136c702b93ae0c0937721943d54118cd9d1c 100644 (file)
@@ -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;