]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
ctf-archive sanity checks
authorAlan Modra <amodra@gmail.com>
Mon, 3 Nov 2025 02:31:42 +0000 (13:01 +1030)
committerAlan Modra <amodra@gmail.com>
Mon, 3 Nov 2025 02:31:42 +0000 (13:01 +1030)
commit626360da44457075f2d9026f0d1d356e5b75c002
tree98c9924b75abf508cd8b93a976ab7a7966649f48
parentc2a2bab96b0c180a799708ba6800fad42012893f
ctf-archive sanity checks

Existing code checks that the first uint64_t ctfa_magic field is
available before reading but neglects to check that the last uint64_t
ctfa_ctfs is available before reading it in ctf_arc_bufpreamble.
ctf_arc_bufopen sets up a pointer to the struct ctf_archive in
ctf_new_archive_internal.  Extend the check to cover the entire struct.

PR 33548
PR 33549
* ctf-archive.c (ctf_arc_bufpreamble, ctf_arc_bufopen): Check
that buffer contains at least an entire struct ctf_archive
when accessing such a struct.
libctf/ctf-archive.c