From: Christos Zoulas Date: Thu, 4 Dec 2014 15:22:05 +0000 (+0000) Subject: Don't bail if there was no error, buf could have been NULL on entry. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=65ec531a42e3ae2fa273b45f95435e7337c7f40d;p=file Don't bail if there was no error, buf could have been NULL on entry. --- diff --git a/src/softmagic.c b/src/softmagic.c index c9c2acb0..c20ae672 100644 --- a/src/softmagic.c +++ b/src/softmagic.c @@ -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) {