]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[v9_6] fix queryperf integer overflow
authorEvan Hunt <each@isc.org>
Wed, 15 Jan 2014 00:58:55 +0000 (16:58 -0800)
committerEvan Hunt <each@isc.org>
Wed, 15 Jan 2014 00:58:55 +0000 (16:58 -0800)
3706. [contrib] queryperf: Fixed a possible integer overflow when
printing results. [RT #35182]

CHANGES
contrib/queryperf/queryperf.c

diff --git a/CHANGES b/CHANGES
index f4aed8e5c1e01a7fb8484cf9b0915b4936748a8f..f59b64a52f2f7a3e79271e8388f5ab9e769f91d9 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3706.  [contrib]       queryperf: Fixed a possible integer overflow when
+                       printing results. [RT #35182]
+
 3704.  [protocol]      Accept integer timestamps in RRSIG records. [RT #35185]
 
        --- 9.6-ESV-R11rc1 released ---
index 6b153271ae8e99fee48a4e4393416e1f145c1e93..0738cc2903043edfd155072cab2e287ffa0e38c2 100644 (file)
@@ -2170,12 +2170,21 @@ main(int argc, char **argv) {
        printf("[Status] Processing input data\n");
 
        while ((sending = keep_sending(&got_eof)) == TRUE ||
-              queries_outstanding() > 0) {
-               print_interval_statistics();
+              queries_outstanding() > 0)
+       {
+               if (num_queries_sent_interval > 0){
+                       /*
+                        * After statistics are printed, send_query()
+                        * needs to be called at least once so that
+                        * time_of_first_query_interval is reset
+                        */
+                       print_interval_statistics();
+               }
                adjust_rate = FALSE;
 
                while ((sending = keep_sending(&got_eof)) == TRUE &&
-                      queries_outstanding() < max_queries_outstanding) {
+                      queries_outstanding() < max_queries_outstanding)
+               {
                        int len = next_input_line(input_line, input_length);
                        if (len == 0) {
                                got_eof = TRUE;