Subject: Don't bail if there was no error, buf could have been NULL on entry ID: CVE-2014-8117 Upstream-Author: Christos Zoulas Date: Thu Dec 4 15:22:05 2014 +0000 Origin: FILE5_20-42-g6bf4527 Last-Update: 2015-01-05 diff --git a/src/softmagic.c b/src/softmagic.c index 9a13acb..50aca88 100644 --- a/src/softmagic.c +++ b/src/softmagic.c @@ -1637,7 +1637,7 @@ mget(struct magic_set *ms, const unsigned char *s, 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) {