Skip to content

pack: msgpack_append_message: Process boundary conditions strictly for extending msgpack maps#11536

Open
cosmo0920 wants to merge 5 commits intomasterfrom
cosmo0920-process-boundary-conditions-strictly-for-extending-msgpack-maps
Open

pack: msgpack_append_message: Process boundary conditions strictly for extending msgpack maps#11536
cosmo0920 wants to merge 5 commits intomasterfrom
cosmo0920-process-boundary-conditions-strictly-for-extending-msgpack-maps

Conversation

@cosmo0920
Copy link
Contributor

@cosmo0920 cosmo0920 commented Mar 11, 2026


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:

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

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • Backport to latest stable release.

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.

Summary by CodeRabbit

  • Bug Fixes

    • Added overflow protection for large buffer operations to prevent size-related errors.
  • Refactor

    • Updated parameter types across message-pack and buffer handling APIs to better support large sizes.
    • Breaking API change: callers must update uses of the affected message-pack expansion API to match the new size-based parameter types.

@cosmo0920 cosmo0920 requested a review from edsiper as a code owner March 11, 2026 09:59
@cosmo0920 cosmo0920 added this to the Fluent Bit v5.0 milestone Mar 11, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cb2b1025-1b1c-487b-84fe-7ec7d0b07e7b

📥 Commits

Reviewing files that changed from the base of the PR and between ca2dfa9 and cb98409.

📒 Files selected for processing (6)
  • include/fluent-bit/flb_pack.h
  • plugins/filter_parser/filter_parser.c
  • plugins/in_syslog/syslog_prot.c
  • plugins/in_udp/udp_conn.c
  • src/flb_msgpack_append_message.c
  • src/flb_pack.c
🚧 Files skipped from review as they are similar to previous changes (2)
  • plugins/in_syslog/syslog_prot.c
  • plugins/in_udp/udp_conn.c

📝 Walkthrough

Walkthrough

Widened size-related types from int to size_t for flb_msgpack_expand_map and propagated matching local variable/parameter type changes across core and plugin code; added overflow guards in core packing logic. No control-flow or behavioral changes beyond size/overflow handling.

Changes

Cohort / File(s) Summary
Public API Header
include/fluent-bit/flb_pack.h
Updated flb_msgpack_expand_map signature: obj_arr_len from intsize_t, out_size from int*size_t*.
Core Implementation
src/flb_pack.c, src/flb_msgpack_append_message.c
Implementation signature and local variables changed to size_t; added #include <stdint.h> and #include <limits.h>; added overflow guards and explicit cast to uint32_t for msgpack_pack_map.
Plugin Updates
plugins/filter_parser/filter_parser.c, plugins/in_syslog/syslog_prot.c, plugins/in_udp/udp_conn.c
Local buffer-size variables (new_size, modified_data_size, etc.) changed from intsize_t to match updated semantics; no logic changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

docs-required, backport to v4.0.x

Suggested reviewers

  • edsiper
  • koleini
  • fujimotos

Poem

🐰 From int to size_t I hop with glee,
Bigger bins for bytes, safer memory,
I check for overflows, tidy and light,
Nibbles of code made firm and right,
Hoppity-hop — a tiny bytey sight! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main change: strict boundary condition handling for extending msgpack maps, which aligns with the primary commit message and code changes implementing overflow guards and size_t type safety.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cosmo0920-process-boundary-conditions-strictly-for-extending-msgpack-maps
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
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.

1 participant