Uploaded image for project: 'Qpid Dispatch'
  1. Qpid Dispatch
  2. DISPATCH-2106

[HTTP2] coverity errors

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.16.0
    • 1.17.0
    • Protocol Adaptors
    • None

    Description

      View in coverity website

      {{** CID 370602: Control flow issues (DEADCODE)
      /home/kgiusti/work/dispatch/qpid-dispatch/src/adaptors/http2/http2_adaptor.c: 1942 in qdr_http_deliver()

      ________________________________________________________________________________________________________

          • CID 370602: Control flow issues (DEADCODE)
            /home/kgiusti/work/dispatch/qpid-dispatch/src/adaptors/http2/http2_adaptor.c: 1942 in qdr_http_deliver()
            1936 if (stream_data->status == QD_STREAM_FULLY_CLOSED && disp == PN_ACCEPTED) { 1937 qd_log(http2_adaptor->log_source, QD_LOG_TRACE, "[C%"PRIu64"][S%"PRId32"] qdr_http_deliver - calling free_http2_stream_data", conn->conn_id, stream_data->stream_id); 1938 free_http2_stream_data(stream_data, false); 1939 }

            1940 return disp;
            1941 }
            >>> CID 370602: Control flow issues (DEADCODE)
            >>> Execution cannot reach this statement: "return 0UL;".
            1942 return 0;
            1943 }
            1944
            1945
            1946 static int handle_incoming_http(qdr_http2_connection_t *conn)
            1947

            { ** CID 363441: API usage errors (PRINTF_ARGS) ________________________________________________________________________________________________________ *** CID 363441: API usage errors (PRINTF_ARGS) /home/kgiusti/work/dispatch/qpid-dispatch/src/adaptors/http2/http2_adaptor.c: 283 in write_buffers() 277 i ++; 278 279 }

            280
            281 if (i >0)

            Unknown macro: {282 size_t num_buffers_written = pn_raw_connection_write_buffers(session_data->conn->pn_raw_conn, raw_buffers, num_buffs);>>> CID 363441}
        • CID 363429: (PRINTF_ARGS)

      ________________________________________________________________________________________________________

          • CID 363429: (PRINTF_ARGS)
            /home/kgiusti/work/dispatch/qpid-dispatch/src/adaptors/http2/http2_adaptor.c: 2481 in handle_connection_event()
            2475 if (written > 0 && !conn->ingress && !conn->first_pinged) { 2476 // Send a PING frame 4 seconds after opening an egress connection. 2477 qd_timer_schedule(conn->ping_timer, PING_INTERVAL * 1000); 2478 conn->first_pinged = true; 2479 }

            2480
            >>> CID 363429: (PRINTF_ARGS)
            >>> Argument "written" to format specifier "%i" was expected to have type "int" but has type "unsigned long".
            2481 qd_log(log, QD_LOG_TRACE, "[C%"PRIu64"] PN_RAW_CONNECTION_WRITTEN Wrote %i bytes, DEQ_SIZE(session_data->buffs) = %zu", conn->conn_id, written, DEQ_SIZE(conn->session_data->buffs));
            2482 restart_streams(conn);
            2483 break;
            2484 }
            2485 default:
            2486 break;
            /home/kgiusti/work/dispatch/qpid-dispatch/src/adaptors/http2/http2_adaptor.c: 2458 in handle_connection_event()
            2452 }
            2453 case PN_RAW_CONNECTION_WRITTEN: {
            2454 pn_raw_buffer_t buffs[WRITE_BUFFERS];
            2455 size_t n;
            2456 size_t written = 0;
            2457 if (conn->pn_raw_conn == 0)

            { >>> CID 363429: (PRINTF_ARGS) >>> This argument was not used by the format string: "written". 2458 qd_log(log, QD_LOG_TRACE, "[C%"PRIu64"] PN_RAW_CONNECTION_WRITTEN, No pn_raw_conn", conn->conn_id, written); 2459 break; 2460 }

            2461 while ( (n = pn_raw_connection_take_written_buffers(conn->pn_raw_conn, buffs, WRITE_BUFFERS)) ) {
            2462 for (size_t i = 0; i < n; ++i) {
            2463 written += buffs[i].size;

        • CID 363423: API usage errors (PRINTF_ARGS)

      ________________________________________________________________________________________________________

          • CID 363423: API usage errors (PRINTF_ARGS)
            /home/kgiusti/work/dispatch/qpid-dispatch/src/adaptors/http2/http2_adaptor.c: 560 in snd_data_callback()
            554 if (pn_raw_buffs[idx].size > 0)
            Unknown macro: {555 //int bytes_remaining = length - bytes_sent;556 //if (bytes_remaining > pn_raw_buffs[idx].size) { 557 memcpy(qd_http2_buffer_cursor(http2_buff), pn_raw_buffs[idx].bytes, pn_raw_buffs[idx].size); 558 qd_http2_buffer_insert(http2_buff, pn_raw_buffs[idx].size); 559 bytes_sent += pn_raw_buffs[idx].size; >>> CID 363423: API usage errors (PRINTF_ARGS) >>> Argument "pn_raw_buffs[idx].size" to format specifier "%zu" was expected to have type "size_t"("unsigned long") but has type "unsigned int". 560 qd_log(http2_adaptor->protocol_log_source, QD_LOG_TRACE, "[C%"PRIu64"][S%"PRId32"] snd_data_callback memcpy pn_raw_buffs[%i].size=%zu", conn->conn_id, stream_data->stream_id, idx, pn_raw_buffs[idx].size); 561 // }562 // else { 563 // memcpy(qd_http2_buffer_cursor(http2_buff), pn_raw_buffs[idx].bytes, bytes_remaining); 564 // qd_http2_buffer_insert(http2_buff, bytes_remaining); 565 // bytes_sent += bytes_remaining; ** CID 363400: Error handling issues (CHECKED_RETURN) /home/kgiusti/work/dispatch/qpid-dispatch/src/adaptors/http2/http2_adaptor.c: 2396 in handle_connection_event() ________________________________________________________________________________________________________ *** CID 363400: Error handling issues (CHECKED_RETURN) /home/kgiusti/work/dispatch/qpid-dispatch/src/adaptors/http2/http2_adaptor.c: 2396 in handle_connection_event() 2390 conn->client_magic_sent = true; 2391 }2392 qd_log(log, QD_LOG_INFO, "[C%"PRIu64"] Connected Egress (PN_RAW_CONNECTION_CONNECTED)", conn->conn_id);2393 conn->connection_established = true;2394 create_stream_dispatcher_link(conn);2395 qd_log(log, QD_LOG_TRACE, "[C%"PRIu64"] Created stream_dispatcher_link in PN_RAW_CONNECTION_CONNECTED", conn->conn_id);>>> CID 363400}

            2398 break;
            2399 }
            2400 case PN_RAW_CONNECTION_CLOSED_READ:

            { 2401 pn_raw_connection_close(conn->pn_raw_conn); ________________________________________________________________________________________________________ To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yrYzWbMPmorD7XnOuZAY1PF5CxqEeKRARa-2FNIb9NgRx3I5GnaWT0ahntmzOiTsHYFJfTdXTXBeRPsUiGGEXnaDOWhxJ_w8xEUxas-2FGH82wkNPpeCiA-2Fca9GedKFqh2wBbuF5Hks63KpvdX8ua9OXCPRTdvgaN6wJ5z4C2sTXqY04L5a3RYdertN1-2FB9NA8Tq25x2C2-2FoQQRuU8G6vQ74tNg63oy771wTuBf5ZOuYWNDRy5qbjfRja-2BwLS4djseUaLyw5quDN7aSOVQvEqSp1q6Uu3Ga1HzY-2Bf7-2BNxQQEWi9jRLdrWg-3D-3D }

            }

      Attachments

        Activity

          People

            gmurthy Ganesh Murthy
            kgiusti Ken Giusti
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: