Skip to content

Fix use of uninitialized value issue from fuzzing#13140

Open
shukitchan wants to merge 1 commit intoapache:masterfrom
shukitchan:fix/oss-fuzz-4669620266270720-uninit-type-buf
Open

Fix use of uninitialized value issue from fuzzing#13140
shukitchan wants to merge 1 commit intoapache:masterfrom
shukitchan:fix/oss-fuzz-4669620266270720-uninit-type-buf

Conversation

@shukitchan
Copy link
Copy Markdown
Contributor

This pull request refactors the FNV-1a hash implementation to simplify initialization and improve code clarity. The main changes involve moving the FNV initial constants into the class definitions as constexpr static members, initializing member variables directly, and simplifying constructors.

Hash algorithm improvements:

  • Moved FNV initial constants (FNV_INIT_32, FNV_INIT_64) into the respective classes (ATSHash32FNV1a, ATSHash64FNV1a) as static constexpr members and used them to initialize hval directly in the class definition (include/tscore/HashFNV.h). [1] [2]
  • Updated the clear() methods to use the new fnv_init static member instead of external constants (src/tscore/HashFNV.cc). [1] [2]
  • Simplified constructors for ATSHash32FNV1a and ATSHash64FNV1a by using default constructors instead of explicitly calling clear() (src/tscore/HashFNV.cc).

Code style and safety:

  • Zero-initialized the type_buf buffer in Http3FrameFactory::create for improved safety (src/proxy/http3/Http3Frame.cc).

This fixes the reported fuzzing issues
https://oss-fuzz.com/testcase-detail/4669620266270720
https://oss-fuzz.com/testcase-detail/4793610426449920

@shukitchan shukitchan marked this pull request as draft May 6, 2026 21:51
@shukitchan shukitchan self-assigned this May 6, 2026
@shukitchan shukitchan added the Fuzz label May 6, 2026
@shukitchan shukitchan added this to the 11.0.0 milestone May 6, 2026
@ezelkow1
Copy link
Copy Markdown
Member

ezelkow1 commented May 7, 2026

[approve ci freebsd clang-analyzer autest]

@shukitchan shukitchan marked this pull request as ready for review May 7, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants