]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.5' into PHP-5.6
authorAnatol Belski <ab@php.net>
Thu, 20 Feb 2014 17:55:05 +0000 (18:55 +0100)
committerAnatol Belski <ab@php.net>
Thu, 20 Feb 2014 17:55:05 +0000 (18:55 +0100)
* PHP-5.5:
  fixed leak introduced after CVE/upgrade

1  2 
ext/fileinfo/libmagic/softmagic.c

index fdd57cfbe19461320cbdf19d11f25de9dd8513a8,33970e59210fe4397e58f9c2a92069f8682e13d6..a2fec719740a37a6b26c8728c2c7ca1a3d533dd2
@@@ -1732,11 -1696,13 +1732,13 @@@ mget(struct magic_set *ms, const unsign
                ms->o.buf = sbuf;
                ms->offset = soffset;
                if (rv == 1) {
 -              if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 &&
 -                          file_printf(ms, m->desc, offset) == -1)
 -                      return -1;
 +                      if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 &&
 +                          file_printf(ms, F(m->desc, "%u"), offset) == -1)
 +                              return -1;
                        if (file_printf(ms, "%s", rbuf) == -1)
                                return -1;
+               }
+               if (rbuf) {
                        efree(rbuf);
                }
                return rv;