Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not free the uninitialized cstring. #5366

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lonicerae
Copy link
Contributor

  • Better deal with corrupted queue messages

  * Better deal with corrupted queue messages
runtime/stringbuf.c Outdated Show resolved Hide resolved
@Cropi
Copy link
Collaborator

Cropi commented Apr 22, 2024

I do confirm that the patch fixes the issue. Another approach could be to change step <= 2 to step <= 3 in objDeserializeProperty:

if(iRet != RS_RET_OK && iRet != RS_RET_NO_PROPLINE) {
  if(step <= 2) {
	  pProp->varType = VARTYPE_NONE;
  }
}

One thing that we should also investigate is how the queue got malformed. Is there a possibility that there were 2 concurrent writes to the same queue file?

@lonicerae
Copy link
Contributor Author

I do confirm that the patch fixes the issue. Another approach could be to change step <= 2 to step <= 3 in objDeserializeProperty:

if(iRet != RS_RET_OK && iRet != RS_RET_NO_PROPLINE) {
  if(step <= 2) {
	  pProp->varType = VARTYPE_NONE;
  }
}

One thing that we should also investigate is how the queue got malformed. Is there a possibility that there were 2 concurrent writes to the same queue file?

Good question! I also would like to know the same. My friend told me it's from a very old version: rsyslog-8.24.0, however, that queue file was generated long time ago. In case I see any other cases, will report to you again. Thanks.

Best regards,
Flos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants