diff --git a/CHANGES b/CHANGES index 6c0cec18d9..ac32bf3068 100644 --- a/CHANGES +++ b/CHANGES @@ -1,11 +1,16 @@ -2.3-700 | 2015-04-16 07:54:12 -0700 +2.3-702 | 2015-04-16 08:13:58 -0700 * Update Mozilla CA list. (Johanna Amann) * Update tests to have them keep using older certificates where appropiate. (Johanna Amann) +2.3-699 | 2015-04-16 09:51:58 -0500 + + * Fix the to_count function to use strtoull versus strtoll. + (Jon Siwek) + 2.3-697 | 2015-04-15 09:51:15 -0700 * Removing error check verifying that an ASCII writer has been diff --git a/VERSION b/VERSION index 8deeeed1fc..b6c6ae4720 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.3-700 +2.3-702 diff --git a/src/bro.bif b/src/bro.bif index e7be72410c..9bba501592 100644 --- a/src/bro.bif +++ b/src/bro.bif @@ -2247,7 +2247,7 @@ function to_count%(str: string%): count const char* s = str->CheckString(); char* end_s; - uint64 u = (uint64) strtoll(s, &end_s, 10); + uint64 u = (uint64) strtoull(s, &end_s, 10); if ( s[0] == '\0' || end_s[0] != '\0' ) { diff --git a/testing/btest/Baseline/bifs.to_count/out b/testing/btest/Baseline/bifs.to_count/out index a283cbaed3..1b0fa383fa 100644 --- a/testing/btest/Baseline/bifs.to_count/out +++ b/testing/btest/Baseline/bifs.to_count/out @@ -7,3 +7,4 @@ 18446744073709551611 0 123 +9223372036854775808 and 9223372036854775808 are the same diff --git a/testing/btest/bifs/to_count.bro b/testing/btest/bifs/to_count.bro index 33754117d4..8de8c5c674 100644 --- a/testing/btest/bifs/to_count.bro +++ b/testing/btest/bifs/to_count.bro @@ -24,4 +24,12 @@ event bro_init() local e: port = 123/tcp; print port_to_count(e); + local origString = "9223372036854775808"; + local directCount: count = 9223372036854775808; + local fromStringCount: count = to_count(origString); + + if ( directCount == fromStringCount ) + print fmt("%s and %s are the same", directCount, fromStringCount); + else + print fmt("%s and %s are not the same", directCount, fromStringCount); }