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

http_server: v1: metrics: fix potential SIGSEGV by memory allocation errors #3047

Merged
merged 1 commit into from
Feb 11, 2021

Conversation

yongtang
Copy link
Contributor

@yongtang yongtang commented Feb 9, 2021

This is a follow up on PR #3045. While #3045 fixed the potential SIGSERV
issue caused by memory allocation error in flb_avro, after searching/reviewing
it looks like src/http_server/api/v1/metrics.c also consists of several
similar issues.

This PR adds proper check to prevent the potential SIGSERV issues.

Signed-off-by: Yong Tang yong.tang.github@outlook.com


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • [n/a] Example configuration file for the change
  • [n/a] Debug log output from testing the change
  • [n/a] Attached Valgrind output that shows no leaks or memory corruption was found

Documentation

  • [n/a] Documentation required for this feature

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

…errors

This is a follow up on PR 3045. While 3045 fixed the potential SIGSERV
issue caused by memory allocation error in flb_avro, after searching/reviewing
it looks like  src/http_server/api/v1/metrics.c also consists of several
similar issues.

This PR adds proper check to prevent the potential SIGSERV issues.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
@edsiper edsiper merged commit 6177451 into fluent:master Feb 11, 2021
@yongtang yongtang deleted the 3044-http_server-malloc branch February 11, 2021 05:45
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.

2 participants