< prev index next >

src/jdk.pack/share/native/common-unpack/zip.cpp

Print this page

        

*** 531,540 **** --- 531,542 ---- assert(minlen <= maxlen); // don't talk nonsense jlong numread = 0; char* bufptr = (char*) buf; char* inbuf = u->gzin->inbuf; size_t inbuflen = sizeof(u->gzin->inbuf); + // capture return values from fread to avoid -Werror=unused-result issues + size_t ret = 0; unpacker::read_input_fn_t read_gzin_fn = (unpacker::read_input_fn_t) u->gzin->read_input_fn; z_stream& zs = *(z_stream*) u->gzin->zstream; while (numread < minlen) { int readlen = (1 << 16); // pretty arbitrary
*** 577,588 **** if (u->gzin->gzcrc != 0) { // Read the CRC information from the gzip container fseek(u->infileptr, -TRAILER_LEN, SEEK_END); uint filecrc; uint filelen; ! fread(&filecrc, sizeof(filecrc), 1, u->infileptr); ! fread(&filelen, sizeof(filelen), 1, u->infileptr); filecrc = SWAP_INT(filecrc); filelen = SWAP_INT(filelen); if (u->gzin->gzcrc != filecrc || // rfc1952; ISIZE is the input size modulo 2^32 u->gzin->gzlen != (filelen & 0xffffffff)) { // CRC error --- 579,590 ---- if (u->gzin->gzcrc != 0) { // Read the CRC information from the gzip container fseek(u->infileptr, -TRAILER_LEN, SEEK_END); uint filecrc; uint filelen; ! ret = fread(&filecrc, sizeof(filecrc), 1, u->infileptr); ! ret = fread(&filelen, sizeof(filelen), 1, u->infileptr); filecrc = SWAP_INT(filecrc); filelen = SWAP_INT(filelen); if (u->gzin->gzcrc != filecrc || // rfc1952; ISIZE is the input size modulo 2^32 u->gzin->gzlen != (filelen & 0xffffffff)) { // CRC error
< prev index next >