Skip to content

Commit

Permalink
Merge pull request rsyslog#5366 from lonicerae/strengthen_destruct_fu…
Browse files Browse the repository at this point in the history
…nctions

Do not free the uninitialized cstring.
  • Loading branch information
rgerhards authored Nov 19, 2024
2 parents fb40da8 + 24f7a56 commit 7c00e0e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion runtime/obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,11 @@ static rsRetVal objDeserializeStr(cstr_t **ppCStr, int iLen, strm_t *pStrm)
cstrFinalize(pCStr);

/* check terminator */
if(c != ':') ABORT_FINALIZE(RS_RET_INVALID_DELIMITER);
if(c != ':') {
/* Initialized to NULL */
*ppCStr = NULL;
ABORT_FINALIZE(RS_RET_INVALID_DELIMITER);
}

*ppCStr = pCStr;

Expand Down

0 comments on commit 7c00e0e

Please sign in to comment.