When ceph_getcwd returns NULL (due to out-of-memory) bail out to avoid
segfault in strlen.
Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Shweta Sodani <ssodani@redhat.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
return -ENOMEM);
cwd = config->ceph_getcwd_fn(config->mount);
+ if (cwd == NULL) {
+ return -ENOMEM;
+ }
cwdlen = strlen(cwd);
/*