]> granicus.if.org Git - php/commitdiff
Partially reapply ba40f505e5804a5f62a1e220b0dce9d417a27f4d
authorAnatol Belski <ab@php.net>
Thu, 30 May 2019 00:48:01 +0000 (02:48 +0200)
committerAnatol Belski <ab@php.net>
Thu, 30 May 2019 00:48:01 +0000 (02:48 +0200)
ext/fileinfo/libmagic/cdf.c

index 1a6b14957073f03c101e4eb503d3612409ebe870..28427dfb640c19ce9bfac3cae6dfae5cc85e8562 100644 (file)
@@ -388,9 +388,8 @@ ssize_t
 cdf_read_sector(const cdf_info_t *info, void *buf, size_t offs, size_t len,
     const cdf_header_t *h, cdf_secid_t id)
 {
-       size_t ss = CDF_SEC_SIZE(h);
        size_t pos = CDF_SEC_POS(h, id);
-       assert(ss == len);
+       assert(CDF_SEC_SIZE(h) == len);
        return cdf_read(info, CAST(zend_off_t, pos), RCAST(char *, buf) + offs, len);
 }
 
@@ -398,9 +397,8 @@ ssize_t
 cdf_read_short_sector(const cdf_stream_t *sst, void *buf, size_t offs,
     size_t len, const cdf_header_t *h, cdf_secid_t id)
 {
-       size_t ss = CDF_SHORT_SEC_SIZE(h);
        size_t pos = CDF_SHORT_SEC_POS(h, id);
-       assert(ss == len);
+       assert(CDF_SHORT_SEC_SIZE(h) == len);
        if (pos + len > CDF_SEC_SIZE(h) * sst->sst_len) {
                DPRINTF(("Out of bounds read %" SIZE_T_FORMAT "u > %"
                    SIZE_T_FORMAT "u\n",