jasper/jasper-1.900.1-Coverity-BAD_SIZEOF.patch
Jiri Popelka c73923e32e CVE-2011-4516, CVE-2011-4517, CERT VU#887409 (#765660)
Fixed problems found by static analysis of code (#761440)
2011-12-09 12:44:44 +01:00

18 lines
985 B
Diff

Error: BAD_SIZEOF
jpc/jpc_enc.c:2105: bad_sizeof: Taking the size of binary expression "tcmpt->numstepsizes * sizeof (uint_fast16_t) /*8*/" is suspicious.
Did you intend "sizeof(tcmpt->numstepsizes) * sizeof (uint_fast16_t) /*8*/"?
diff -up jasper-1.900.1/src/libjasper/jpc/jpc_enc.c.bad_sizeof jasper-1.900.1/src/libjasper/jpc/jpc_enc.c
--- jasper-1.900.1/src/libjasper/jpc/jpc_enc.c.bad_sizeof 2007-01-19 22:43:07.000000000 +0100
+++ jasper-1.900.1/src/libjasper/jpc/jpc_enc.c 2011-06-23 17:28:17.085690561 +0200
@@ -2102,8 +2102,7 @@ static jpc_enc_tcmpt_t *tcmpt_create(jpc
tcmpt->numstepsizes = tcmpt->numbands;
assert(tcmpt->numstepsizes <= JPC_MAXBANDS);
- memset(tcmpt->stepsizes, 0, sizeof(tcmpt->numstepsizes *
- sizeof(uint_fast16_t)));
+ memset(tcmpt->stepsizes, 0, tcmpt->numstepsizes * sizeof(uint_fast16_t));
/* Retrieve information about the various bands. */
jpc_tsfb_getbands(tcmpt->tsfb, jas_seq2d_xstart(tcmpt->data),