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 Mon, Oct 28, 1:51 PM
Reviewer
emaste
Differential Revision
D47292: fstyp: Fix some memory safety bugs
Parents
rG6686056ca354: release: add optional OCI images
Branches
Unknown
Tags
Unknown