queue subsystem: fix NULL pointer dereference during config processing

If the queue parameters were incorrectly given, a NULL pointer derefernce
could happen during config parsing. Once post that stage, no problem could
occur.

Detected by Coverity scan, CID 185339
This commit is contained in:
Rainer Gerhards 2017-11-17 19:17:16 +01:00
parent 325703bc34
commit 2640eb6211

View File

@ -3108,8 +3108,13 @@ qqueueApplyCnfParam(qqueue_t *pThis, struct nvlst *lst)
{
int i;
struct cnfparamvals *pvals;
DEFiRet;
pvals = nvlstGetParams(lst, &pblk, NULL);
if(pvals == NULL) {
parser_errmsg("error processing queue config parameters");
ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS);
}
if(Debug) {
dbgprintf("queue param blk:\n");
cnfparamsPrint(&pblk, pvals);
@ -3207,7 +3212,8 @@ qqueueApplyCnfParam(qqueue_t *pThis, struct nvlst *lst)
}
cnfparamvalsDestruct(pvals, &pblk);
return RS_RET_OK;
finalize_it:
RETiRet;
}