diff options
Diffstat (limited to 'libctf/ctf-open.c')
-rw-r--r-- | libctf/ctf-open.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libctf/ctf-open.c b/libctf/ctf-open.c index b7846bd..f8eeaab 100644 --- a/libctf/ctf-open.c +++ b/libctf/ctf-open.c @@ -1384,6 +1384,9 @@ ctf_bufopen_internal (const ctf_sect_t *ctfsect, const ctf_sect_t *symsect, if (pp->ctp_version < CTF_VERSION_3) hdrsz = sizeof (ctf_header_v2_t); + if (_libctf_unlikely_ (pp->ctp_flags > CTF_F_MAX)) + return (ctf_set_open_errno (errp, ECTF_FLAGS)); + if (ctfsect->cts_size < hdrsz) return (ctf_set_open_errno (errp, ECTF_NOCTFBUF)); |