diff options
author | Steve Dickson <steved@redhat.com> | 2009-07-15 06:21:54 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2009-07-15 06:21:54 -0400 |
commit | b46dc42505da799a05a3a5e8f004b308f6b9eef7 (patch) | |
tree | a12a39da61901986854695144f5defc4daad4417 /utils/mount/stropts.c | |
parent | 906f0b27730b0506a24ed43029983b4d6819dd12 (diff) | |
download | nfs-utils-b46dc42505da799a05a3a5e8f004b308f6b9eef7.tar.gz nfs-utils-b46dc42505da799a05a3a5e8f004b308f6b9eef7.tar.xz nfs-utils-b46dc42505da799a05a3a5e8f004b308f6b9eef7.zip |
Don't use initialized garbage for address lengths
Make sure address lengths are initialized before
call calling nfs_extract_server_addresses() from
nfs_rewrite_pmap_mount_options(). Otherwise the
length check in nfs_string_to_sockaddr() can fail
since its will be using garbage from the stack.
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/mount/stropts.c')
-rw-r--r-- | utils/mount/stropts.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c index 9d82bb1..a12ace7 100644 --- a/utils/mount/stropts.c +++ b/utils/mount/stropts.c @@ -420,11 +420,11 @@ nfs_rewrite_pmap_mount_options(struct mount_options *options) { struct sockaddr_storage nfs_address; struct sockaddr *nfs_saddr = (struct sockaddr *)&nfs_address; - socklen_t nfs_salen; + socklen_t nfs_salen = sizeof(nfs_address); struct pmap nfs_pmap; struct sockaddr_storage mnt_address; struct sockaddr *mnt_saddr = (struct sockaddr *)&mnt_address; - socklen_t mnt_salen; + socklen_t mnt_salen = sizeof(mnt_address); struct pmap mnt_pmap; char *option; |