| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,4 @@ | |||
| 1 | 1 | agl@chromium.org | |
| 2 | 2 | cavalcantii@chromium.org | |
| 3 | 3 | cblume@chromium.org | |
| 4 | - noel@chromium.org | ||
| 5 | 4 | scroggo@google.com | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1 +0,0 @@ | |||
| 1 | - noel@chromium.org | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,2 @@ | |||
| 1 | 1 | cblume@chromium.org | |
| 2 | 2 | hans@chromium.org | |
| 3 | - noel@chromium.org | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,6 +38,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { | |||
| 38 | 38 | int ret = | |
| 39 | 39 | deflateInit2(&stream, level, Z_DEFLATED, windowBits, memLevel, strategy); | |
| 40 | 40 | ASSERT(ret == Z_OK); | |
| 41 | + | ||
| 42 | + size_t deflate_bound = deflateBound(&stream, src.size()); | ||
| 43 | + | ||
| 41 | 44 | std::vector<uint8_t> compressed(src.size() * 2 + 1000); | |
| 42 | 45 | stream.next_out = compressed.data(); | |
| 43 | 46 | stream.avail_out = compressed.size(); | |
@@ -54,6 +57,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { | |||
| 54 | 57 | compressed.resize(compressed.size() - stream.avail_out); | |
| 55 | 58 | deflateEnd(&stream); | |
| 56 | 59 | ||
| 60 | + // Check that the bound was correct. | ||
| 61 | + ASSERT(compressed.size() <= deflate_bound); | ||
| 62 | + | ||
| 57 | 63 | // Verify that the data decompresses correctly. | |
| 58 | 64 | ret = inflateInit2(&stream, windowBits); | |
| 59 | 65 | ASSERT(ret == Z_OK); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -395,9 +395,7 @@ void cover_support(void) | |||
| 395 | 395 | mem_setup(&strm); | |
| 396 | 396 | strm.avail_in = 0; | |
| 397 | 397 | strm.next_in = Z_NULL; | |
| 398 | - char versioncpy[] = ZLIB_VERSION; | ||
| 399 | - versioncpy[0] -= 1; | ||
| 400 | - ret = inflateInit_(&strm, versioncpy, (int)sizeof(z_stream)); | ||
| 398 | + ret = inflateInit_(&strm, "!", (int)sizeof(z_stream)); | ||
| 401 | 399 | assert(ret == Z_VERSION_ERROR); | |
| 402 | 400 | mem_done(&strm, "wrong version"); | |
| 403 | 401 | ||
@@ -486,7 +484,8 @@ local unsigned pull(void *desc, unsigned char **buf) | |||
| 486 | 484 | ||
| 487 | 485 | local int push(void *desc, unsigned char *buf, unsigned len) | |
| 488 | 486 | { | |
| 489 | - buf += len; | ||
| 487 | + (void)buf; | ||
| 488 | + (void)len; | ||
| 490 | 489 | return desc != Z_NULL; /* force error if desc not null */ | |
| 491 | 490 | } | |
| 492 | 491 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -539,7 +539,7 @@ typedef uLong FAR uLongf; | |||
| 539 | 539 | #if !defined(_WIN32) && defined(Z_LARGE64) | |
| 540 | 540 | # define z_off64_t off64_t | |
| 541 | 541 | #else | |
| 542 | - # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) | ||
| 542 | + # if defined(_WIN32) && !defined(__GNUC__) | ||
| 543 | 543 | # define z_off64_t __int64 | |
| 544 | 544 | # else | |
| 545 | 545 | # define z_off64_t z_off_t | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -526,7 +526,7 @@ typedef uLong FAR uLongf; | |||
| 526 | 526 | #if !defined(_WIN32) && defined(Z_LARGE64) | |
| 527 | 527 | # define z_off64_t off64_t | |
| 528 | 528 | #else | |
| 529 | - # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) | ||
| 529 | + # if defined(_WIN32) && !defined(__GNUC__) | ||
| 530 | 530 | # define z_off64_t __int64 | |
| 531 | 531 | # else | |
| 532 | 532 | # define z_off64_t z_off_t | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -728,7 +728,7 @@ ZEXTERN int ZEXPORT deflateParams(z_streamp strm, | |||
| 728 | 728 | Then no more input data should be provided before the deflateParams() call. | |
| 729 | 729 | If this is done, the old level and strategy will be applied to the data | |
| 730 | 730 | compressed before deflateParams(), and the new level and strategy will be | |
| 731 | - applied to the the data compressed after deflateParams(). | ||
| 731 | + applied to the data compressed after deflateParams(). | ||
| 732 | 732 | ||
| 733 | 733 | deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream | |
| 734 | 734 | state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if | |
| Back | FazBrowse Home | New Git URL |
0 commit comments