Ganesh Murthy created DISPATCH-1899:
---------------------------------------

             Summary: Coverity issues on master branch
                 Key: DISPATCH-1899
                 URL: https://issues.apache.org/jira/browse/DISPATCH-1899
             Project: Qpid Dispatch
          Issue Type: Bug
          Components: Protocol Adaptors
            Reporter: Ganesh Murthy
             Fix For: 1.15.0


{noformat}
Please find the latest report on new defect(s) introduced to Apache Qpid 
dispatch-router found with Coverity Scan.
6 new defect(s) introduced to Apache Qpid dispatch-router found with Coverity 
Scan.
New defect(s) Reported-by: Coverity Scan
Showing 6 of 6 defect(s)** CID 364262:  API usage errors  (PRINTF_ARGS)
________________________________________________________________________________________________________
*** CID 364262:  API usage errors  (PRINTF_ARGS)
/qpid-dispatch/src/adaptors/tcp_adaptor.c: 126 in grant_read_buffers()
120     static void grant_read_buffers(qdr_tcp_connection_t *conn)
121     {
122         pn_raw_buffer_t raw_buffers[READ_BUFFERS];
123         // Give proactor more read buffers for the socket
124         if (!pn_raw_connection_is_read_closed(conn->pn_raw_conn)) {
125             size_t desired = 
pn_raw_connection_read_buffers_capacity(conn->pn_raw_conn);
>>>     CID 364262:  API usage errors  (PRINTF_ARGS)
>>>     Argument "desired" to format specifier "%i" was expected to have type 
>>> "int" but has type "unsigned long".
126             qd_log(tcp_adaptor->log_source, QD_LOG_DEBUG, "[C%"PRIu64"] 
Granted %i read buffers", conn->conn_id, desired);
127             while (desired) {
128                 size_t i;
129                 for (i = 0; i < desired && i < READ_BUFFERS; ++i) {
130                     qd_buffer_t *buf = qd_buffer();
131                     raw_buffers[i].bytes = (char*) qd_buffer_base(buf);** 
CID 364261:    
(PRINTF_ARGS)________________________________________________________________________________________________________
*** CID 364261:    (PRINTF_ARGS)
/qpid-dispatch/src/adaptors/http1/http1_client.c: 1516 in 
qdr_http1_client_core_link_deliver()
1510         // aggregation format
1511         if (hconn->cfg.aggregation != QD_AGGREGATION_NONE) {
1512             if (!qd_message_receive_complete(msg)) {
1513                 qd_log(qdr_http1_adaptor->log, QD_LOG_DEBUG, 
"[C%"PRIu64"][L%"PRIu64"] Response incomplete (%i responses received)", 
hconn->conn_id, link->identity, DEQ_SIZE(hreq->responses));
1514                 return 0;
1515             }
>>>     CID 364261:    (PRINTF_ARGS)
>>>     Argument "hreq->responses.size" to format specifier "%i" was expected 
>>> to have type "int" but has type "unsigned long".
1516             qd_log(qdr_http1_adaptor->log, QD_LOG_DEBUG, 
"[C%"PRIu64"][L%"PRIu64"] Received response (%i responses received), settling", 
hconn->conn_id, link->identity, DEQ_SIZE(hreq->responses));
1517             rmsg->dispo = PN_ACCEPTED;
1518             qd_message_set_send_complete(msg);
1519             qdr_link_flow(qdr_http1_adaptor->core, link, 1, false);
1520             qdr_delivery_remote_state_updated(qdr_http1_adaptor->core,
1521                                               rmsg->dlv,
/qpid-dispatch/src/adaptors/http1/http1_client.c: 1513 in 
qdr_http1_client_core_link_deliver()
1507     
1508         // when aggregating responses, they are saved on the list until
1509         // the request has been settled, then encoded in the configured
1510         // aggregation format
1511         if (hconn->cfg.aggregation != QD_AGGREGATION_NONE) {
1512             if (!qd_message_receive_complete(msg)) {
>>>     CID 364261:    (PRINTF_ARGS)
>>>     Argument "hreq->responses.size" to format specifier "%i" was expected 
>>> to have type "int" but has type "unsigned long".
1513                 qd_log(qdr_http1_adaptor->log, QD_LOG_DEBUG, 
"[C%"PRIu64"][L%"PRIu64"] Response incomplete (%i responses received)", 
hconn->conn_id, link->identity, DEQ_SIZE(hreq->responses));
1514                 return 0;
1515             }
1516             qd_log(qdr_http1_adaptor->log, QD_LOG_DEBUG, 
"[C%"PRIu64"][L%"PRIu64"] Received response (%i responses received), settling", 
hconn->conn_id, link->identity, DEQ_SIZE(hreq->responses));
1517             rmsg->dispo = PN_ACCEPTED;
1518             qd_message_set_send_complete(msg);** CID 364260:  API usage 
errors  
(PRINTF_ARGS)________________________________________________________________________________________________________
*** CID 364260:  API usage errors  (PRINTF_ARGS)
/qpid-dispatch/src/adaptors/tcp_adaptor.c: 178 in handle_incoming()
172                     qd_buffer_free(buf);
173                     free_count++;
174                 }
175             }
176         }
177     
>>>     CID 364260:  API usage errors  (PRINTF_ARGS)
>>>     Argument "buffers.size" to format specifier "%i" was expected to have 
>>> type "int" but has type "unsigned long".
178         qd_log(tcp_adaptor->log_source, QD_LOG_DEBUG, "[C%"PRIu64"] Took %i 
read buffers", conn->conn_id, DEQ_SIZE(buffers));
179         qd_log(tcp_adaptor->log_source, QD_LOG_DEBUG, "[C%"PRIu64"] Freed 
%i read buffers", conn->conn_id, free_count);
180         grant_read_buffers(conn);
181     
182         if (conn->instream) {
183             
qd_message_stream_data_append(qdr_delivery_message(conn->instream), 
&buffers);** CID 364139:  API usage errors  
(PRINTF_ARGS)________________________________________________________________________________________________________
*** CID 364139:  API usage errors  (PRINTF_ARGS)
/qpid-dispatch/src/adaptors/http_common.c: 626 in _add_http_request_info_CT()
620                 _free_qdr_http_request_info(update);
621                 qd_log(qd_log_source(QD_HTTP_LOG_SOURCE), QD_LOG_DEBUG, 
"Updated http request info %s", record->key);
622             }
623         }
624         if (!updated) {
625             DEQ_INSERT_TAIL(_get_request_info()->records, update);
>>>     CID 364139:  API usage errors  (PRINTF_ARGS)
>>>     Argument "_get_request_info()->records.size" to format specifier "%i" 
>>> was expected to have type "int" but has type "unsigned long".
626             qd_log(qd_log_source(QD_HTTP_LOG_SOURCE), QD_LOG_DEBUG, "Added 
http request info %s (%i)", update->key, 
DEQ_SIZE(_get_request_info()->records));
627         }
628     }
629     
630     static void _add_http_request_info(qdr_core_t *core, 
qdr_http_request_info_t* record)
631     {** CID 364138:  API usage errors  (PRINTF_ARGS)
________________________________________________________________________________________________________
*** CID 364138:  API usage errors  (PRINTF_ARGS)
/qpid-dispatch/src/adaptors/tcp_adaptor.c: 1068 in qdr_tcp_deliver()
1062     
1063     static uint64_t qdr_tcp_deliver(void *context, qdr_link_t *link, 
qdr_delivery_t *delivery, bool settled)
1064     {
1065         void* link_context = qdr_link_get_context(link);
1066         if (link_context) {
1067             qdr_tcp_connection_t* tc = (qdr_tcp_connection_t*) 
link_context;
>>>     CID 364138:  API usage errors  (PRINTF_ARGS)
>>>     Argument "delivery" to format specifier "%lx" was expected to have type 
>>> "unsigned long" but has type "qdr_delivery_t *".
1068             qd_log(tcp_adaptor->log_source, QD_LOG_DEBUG, 
"[C%"PRIu64"][L%"PRIu64"] qdr_tcp_deliver Delivery event dlv:%lx", tc->conn_id, 
tc->outgoing_id, delivery);
1069             if (tc->egress_dispatcher) {
1070                 qd_log(tcp_adaptor->log_source, QD_LOG_DEBUG, 
"[C%"PRIu64"][L%"PRIu64"] tcp_adaptor initiating egress connection %p", 
tc->conn_id, tc->outgoing_id, delivery);
1071                 qdr_tcp_connection_egress(&(tc->config), tc->server, 
delivery);
1072                 return QD_DELIVERY_MOVED_TO_NEW_LINK;
1073             } else if (!tc->outstream) {** CID 363429:  API usage errors  
(PRINTF_ARGS)________________________________________________________________________________________________________
*** CID 363429:  API usage errors  (PRINTF_ARGS)
/qpid-dispatch/src/adaptors/tcp_adaptor.c: 587 in handle_connection_event()
581                     written += buffs[i].size;
582                     if (buffs[i].context) {
583                         
qd_message_stream_data_release((qd_message_stream_data_t*) buffs[i].context);
584                     }
585                 }
586             }
>>>     CID 363429:  API usage errors  (PRINTF_ARGS)
>>>     Argument "written" to format specifier "%i" was expected to have type 
>>> "int" but has type "unsigned long".
587             qd_log(log, QD_LOG_DEBUG, "[C%"PRIu64"] 
PN_RAW_CONNECTION_WRITTEN Wrote %i bytes", conn->conn_id, written);
588             conn->last_out_time = tcp_adaptor->core->uptime_ticks;
589             conn->bytes_out += written;
590             while (qdr_connection_process(conn->qdr_conn)) {}
591             break;
592         } {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to