MOUNT: when processing the mount response, check status before dereferencing data...
[deb_libnfs.git] / lib / libnfs-sync.c
index 09e197ad312fcf3a5c6ee77a8ad9fcde72aff454..82578f1e9a07fbfb39798ad88986065e9ebcf3cd 100644 (file)
@@ -47,6 +47,7 @@
 #include <sys/sockio.h>
 #endif
 
+#include "libnfs-zdr.h"
 #include "libnfs.h"
 #include "libnfs-raw.h"
 #include "libnfs-raw-mount.h"
@@ -1146,7 +1147,7 @@ int nfs_link(struct nfs_context *nfs, const char *oldpath, const char *newpath)
 void mount_getexports_cb(struct rpc_context *mount_context, int status, void *data, void *private_data)
 {
        struct sync_cb_data *cb_data = private_data;
-       exports export = *(exports *)data;
+       exports export;
 
        cb_data->is_finished = 1;
        cb_data->status = status;
@@ -1157,6 +1158,7 @@ void mount_getexports_cb(struct rpc_context *mount_context, int status, void *da
                return;
        }
 
+       export = *(exports *)data;
        while (export != NULL) {
                exports new_export;