diff options
author | Jianhong Yin <yin-jianhong@163.com> | 2017-02-02 06:21:15 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2017-02-02 06:21:15 -0500 |
commit | 0712b5507866d6b3c900623eb1f81fffaec80ae2 (patch) | |
tree | 2d5e2910b1305d98caf2e2b3bd7653d62ac1a51f /utils/mount/stropts.c | |
parent | 99e1a48511ea90efc40f7faf7d6fc29b28876695 (diff) | |
download | nfs-utils-0712b5507866d6b3c900623eb1f81fffaec80ae2.tar.gz nfs-utils-0712b5507866d6b3c900623eb1f81fffaec80ae2.tar.xz nfs-utils-0712b5507866d6b3c900623eb1f81fffaec80ae2.zip |
mount: fix mount fail that caused by uninitialized struct
From: "Jianhong.Yin" <yin-jianhong@163.com>
recent changes of utils/mount cause a regression mount fail:
https://bugzilla.redhat.com/show_bug.cgi?id=1415024
can not reproduce it on x86_64(gcc on x86_64 might do struct
initialize by default, I'm not sure). but it can be reproduced
always on platform ppc64le aarch64.
Signed-off-by: Jianhong Yin <yin-jianhong@163.com>
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, 4 insertions, 0 deletions
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c index 387d734..a9ff95d 100644 --- a/utils/mount/stropts.c +++ b/utils/mount/stropts.c @@ -517,6 +517,10 @@ nfs_rewrite_pmap_mount_options(struct mount_options *options, int checkv4) unsigned long protocol; struct pmap mnt_pmap; + /* initialize structs */ + memset(&nfs_pmap, 0, sizeof(struct pmap)); + memset(&mnt_pmap, 0, sizeof(struct pmap)); + /* * Version and transport negotiation is not required * and does not work for RDMA mounts. |