Skip to content

Commit

Permalink
Don't use signed here, hash computation can overflow. (apache#1612)
Browse files Browse the repository at this point in the history
  • Loading branch information
morlovich committed Aug 8, 2017
1 parent aadbc70 commit 5fe092c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/instaweb/rewriter/server_context_test.cc
Expand Up @@ -1278,7 +1278,7 @@ TEST_F(BeaconTest, BasicPcacheSetup) {
TEST_F(BeaconTest, HandleBeaconRenderedDimensionsofImages) {
GoogleString img1 = "http://www.example.com/img1.png";
GoogleString hash1 = IntegerToString(
HashString<CasePreserve, int>(img1.c_str(), img1.size()));
HashString<CasePreserve, unsigned>(img1.c_str(), img1.size()));
options()->EnableFilter(RewriteOptions::kResizeToRenderedImageDimensions);
RenderedImages rendered_images;
RenderedImages_Image* images = rendered_images.add_image();
Expand All @@ -1301,9 +1301,9 @@ TEST_F(BeaconTest, HandleBeaconCritImages) {
GoogleString img1 = "http://www.example.com/img1.png";
GoogleString img2 = "http://www.example.com/img2.png";
GoogleString hash1 = IntegerToString(
HashString<CasePreserve, int>(img1.c_str(), img1.size()));
HashString<CasePreserve, unsigned>(img1.c_str(), img1.size()));
GoogleString hash2 = IntegerToString(
HashString<CasePreserve, int>(img2.c_str(), img2.size()));
HashString<CasePreserve, unsigned>(img2.c_str(), img2.size()));

StringSet critical_image_hashes;
critical_image_hashes.insert(hash1);
Expand Down

0 comments on commit 5fe092c

Please sign in to comment.