In mdd_changelog_data_store_by_fid() part of the function checked
for the return value of lu_ucred(), part of it did not. This lead
to NULL pointer dereferencing.
Signed-off-by: Quentin Bouget <quentin.bouget@cea.fr>
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Iefe9d10191e499aec94415fb6fe0d5d2064f86f0
Reviewed-on: https://review.whamcloud.com/30707
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
crf &= CLF_FLAGMASK;
crf |= CLF_EXTRA_FLAGS;
- if (uc != NULL && uc->uc_jobid[0] != '\0')
- crf |= CLF_JOBID;
+ if (uc) {
+ if (uc->uc_jobid[0] != '\0')
+ crf |= CLF_JOBID;
+ xflags |= CLFE_UIDGID;
+ }
if (sname != NULL)
crf |= CLF_RENAME;
else
crf |= CLF_VERSION;
- xflags |= CLFE_UIDGID;
-
rec->cr.cr_flags = crf;
if (crf & CLF_EXTRA_FLAGS) {
int rc;
flags = (flags & CLF_FLAGMASK) | CLF_VERSION | CLF_EXTRA_FLAGS;
- if (uc != NULL && uc->uc_jobid[0] != '\0')
- flags |= CLF_JOBID;
- xflags |= CLFE_UIDGID;
+ if (uc) {
+ if (uc->uc_jobid[0] != '\0')
+ flags |= CLF_JOBID;
+ xflags |= CLFE_UIDGID;
+ }
reclen = llog_data_len(LLOG_CHANGELOG_HDR_SZ +
changelog_rec_offset(flags & CLF_SUPPORTED,