diff options
author | Jakub Jelen <jjelen@redhat.com> | 2023-02-20 16:16:01 +0100 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2023-03-07 15:36:12 +0900 |
commit | 3fd3bb31597f80c76a94ea62e42d58d796beabf1 (patch) | |
tree | 3b07b367cb714754b03232722b317d47e21bcbd3 /src/fips.c | |
parent | 45b80678109e5817b7cd15566a9d6c96b064b95f (diff) | |
download | libgcrypt-3fd3bb31597f80c76a94ea62e42d58d796beabf1.tar.gz |
fips: Check return value from ftell
* src/fips.c (get_file_offset): Check return value of ftell to be able
to detect errors.
--
Originally reported by coverity.
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Diffstat (limited to 'src/fips.c')
-rw-r--r-- | src/fips.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -681,6 +681,8 @@ get_file_offset (FILE *fp, ElfW (Ehdr) *ehdr_p, return gpg_error_from_syserror (); off = ftell (fp); + if (off < 0) + return gpg_error_from_syserror (); if (shdr.sh_type == SHT_NOTE && shdr.sh_flags == 0 && shdr.sh_size == 48) { const char header_of_the_note[] = { |