]> granicus.if.org Git - file/commitdiff
check file_printf()
authorChristos Zoulas <christos@zoulas.com>
Wed, 1 Aug 2018 10:09:47 +0000 (10:09 +0000)
committerChristos Zoulas <christos@zoulas.com>
Wed, 1 Aug 2018 10:09:47 +0000 (10:09 +0000)
src/readelf.c

index 2c4cddb6aa907c33918cecc8261de82b872abeff..e9a125f2063e247a5a50a9fe3768eb66575d12db 100644 (file)
@@ -27,7 +27,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$File: readelf.c,v 1.148 2018/08/01 10:02:20 christos Exp $")
+FILE_RCSID("@(#)$File: readelf.c,v 1.149 2018/08/01 10:09:47 christos Exp $")
 #endif
 
 #ifdef BUILTIN_ELF
@@ -577,9 +577,11 @@ do_os_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
     size_t noff, size_t doff, int *flags)
 {
        if (namesz == 5 && strcmp((char *)&nbuf[noff], "SuSE") == 0 &&
-           type == NT_GNU_VERSION && descsz == 2) {
-           *flags |= FLAGS_DID_OS_NOTE;
-           file_printf(ms, ", for SuSE %d.%d", nbuf[doff], nbuf[doff + 1]);
+               type == NT_GNU_VERSION && descsz == 2) {
+               *flags |= FLAGS_DID_OS_NOTE;
+               if (file_printf(ms, ", for SuSE %d.%d", nbuf[doff],
+                   nbuf[doff + 1]) == -1)
+                   return -1;
            return 1;
        }