summaryrefslogtreecommitdiffstats
path: root/api/src/glfs-handleops.c
diff options
context:
space:
mode:
Diffstat (limited to 'api/src/glfs-handleops.c')
-rw-r--r--api/src/glfs-handleops.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
index 0fe5b35ff11..e8fbae4074e 100644
--- a/api/src/glfs-handleops.c
+++ b/api/src/glfs-handleops.c
@@ -1288,6 +1288,10 @@ pub_glfs_h_create_from_handle (struct glfs *fs, unsigned char *handle, int len,
memcpy (loc.gfid, handle, GFAPI_HANDLE_LENGTH);
+ /* make sure the gfid received is valid */
+ GF_VALIDATE_OR_GOTO ("glfs_h_create_from_handle",
+ !(gf_uuid_is_null (loc.gfid)), out);
+
newinode = inode_find (subvol->itable, loc.gfid);
if (newinode) {
if (!stat) /* No need of lookup */