core: potential NULL pointer dereference in config parsing

This happens if there is a problem with the timezone parameters.
Affects only startup, once started, no problem exists.

Detected by Coverty scan; CID 185414
This commit is contained in:
Rainer Gerhards 2017-10-26 13:05:46 +02:00
parent 5d32899f3e
commit 9074b5ab97

View File

@ -908,6 +908,11 @@ glblProcessTimezone(struct cnfobj *o)
int i;
pvals = nvlstGetParams(o->nvlst, &timezonepblk, NULL);
if(pvals == NULL) {
LogError(0, RS_RET_MISSING_CNFPARAMS, "error processing timezone "
"config parameters");
goto done;
}
if(Debug) {
dbgprintf("timezone param blk after glblProcessTimezone:\n");
cnfparamsPrint(&timezonepblk, pvals);