MOUNT: when processing the mount response, check status before dereferencing data...
[deb_libnfs.git] / lib / libnfs-sync.c
index 737808e429147180a24aa458aa9f1719a036562a..82578f1e9a07fbfb39798ad88986065e9ebcf3cd 100644 (file)
@@ -1147,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;
@@ -1158,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;