Bug 55187 - Integer overflow when computing ONE_YEAR_MS in HTTP CacheManager
Integer overflow when computing ONE_YEAR_MS in HTTP CacheManager
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: HTTP
2.8
Macintosh All
: P2 minor (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2013-07-03 02:21 UTC by Scott Moore
Modified: 2013-07-05 08:45 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Moore 2013-07-03 02:21:10 UTC
The calculation "long ONE_YEAR_MS = 365*86400*1000;" overflows (and computes the wrong value) because the constants are not marked as long. The result is 1,471,228,928 rather than 31,536,000,000.
Comment 1 Sebb 2013-07-05 08:45:54 UTC
Thanks, good catch!

Luckily the exact number of seconds is not critical - the expiry time is arbitrary. Fixed:

URL: http://svn.apache.org/r1499938
Log:
Integer overflow when computing ONE_YEAR_MS in HTTP CacheManager
Bugzilla Id: 55187

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CacheManager.java
    jmeter/trunk/xdocs/changes.xml