12345678910111213141516171819202122232425262728 |
- Subject: Correct error handling for file_printf() (coverity)
- Origin: FILE5_34-32-g813f1b8a <https://github.com/file/file/commit/FILE5_34-32-g813f1b8a>
- Upstream-Author: Christos Zoulas <christos@zoulas.com>
- Date: Thu Aug 2 12:46:02 2018 +0000
- --- a/src/readelf.c
- +++ b/src/readelf.c
- @@ -1035,14 +1035,16 @@
- }
-
- if (namesz & 0x80000000) {
- - (void)file_printf(ms, ", bad note name size 0x%lx",
- - (unsigned long)namesz);
- + if (file_printf(ms, ", bad note name size 0x%lxx",
- + CAST(unsigned long, namesz)) == -1)
- + return -1;
- return 0;
- }
-
- if (descsz & 0x80000000) {
- - (void)file_printf(ms, ", bad note description size 0x%lx",
- - (unsigned long)descsz);
- + if (file_printf(ms, ", bad note description size 0x%lx",
- + CAST(unsigned long, descsz)) == -1)
- + return -1;
- return 0;
- }
-
|