]> granicus.if.org Git - file/commitdiff
Don't bail if there was no error, buf could have been NULL on entry.
authorChristos Zoulas <christos@zoulas.com>
Thu, 4 Dec 2014 15:22:05 +0000 (15:22 +0000)
committerChristos Zoulas <christos@zoulas.com>
Thu, 4 Dec 2014 15:22:05 +0000 (15:22 +0000)
src/softmagic.c

index c9c2acb09c69948c6a5e761c688cd6ef03bbe0b7..c20ae672c09ff98787298c55483c44029437bd9b 100644 (file)
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: softmagic.c,v 1.202 2014/11/28 02:46:39 christos Exp $")
+FILE_RCSID("@(#)$File: softmagic.c,v 1.203 2014/12/04 15:22:05 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -1700,7 +1700,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
                        fprintf(stderr, "indirect @offs=%u[%d]\n", offset, rv);
 
                rbuf = file_pop_buffer(ms, pb);
-               if (rbuf == NULL)
+               if (rbuf == NULL && ms->event_flags & EVENT_HAD_ERR)
                        return -1;
 
                if (rv == 1) {