HomeFreeBSD

fstyp: Fix some memory safety bugs

Description

fstyp: Fix some memory safety bugs

In the hammer2 label reader, make sure to check for a NULL return from
read_buf().

In the NTFS label reader,

  • Avoid an infinite loop if a record length is 0.
  • Avoid walking past the end of the buffer.
  • When a label is found, avoid reading past the end of the buffer.

PR: 278281
Reviewed by: emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D47292

(cherry picked from commit 878ede1a0d0f10f851b2bc54be1e28f512bfc016)

Details

Provenance
markjAuthored on Oct 28 2024, 1:51 PM
Reviewer
emaste
Differential Revision
D47292: fstyp: Fix some memory safety bugs
Parents
rG69d334e3bf2a: ocs_fc: Remove a stray semicolon
Branches
Unknown
Tags
Unknown