Hi,
Please find the latest report on new defect(s) introduced to Synchronet found with Coverity Scan.
1 new defect(s) introduced to Synchronet found with Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)
** CID 651667: (INTEGER_OVERFLOW)
/main.cpp: 2844 in output_thread(void *)()
/main.cpp: 2806 in output_thread(void *)()
_____________________________________________________________________________________________
*** CID 651667: (INTEGER_OVERFLOW)
/main.cpp: 2844 in output_thread(void *)()
2838 int result = mqtt_pub_message(&mqtt, TOPIC_BBS, spy_topic, buf + bufbot, i, /* retain: */ false);
2839 if (result != MQTT_SUCCESS)
2840 lprintf(LOG_WARNING, "%s ERROR %d (%d) publishing node output (%u bytes): %s"
2841 , node, result, errno, i, spy_topic);
2842 }
2843 if (spy_socket[sbbs->cfg.node_num - 1] != INVALID_SOCKET)
CID 651667: (INTEGER_OVERFLOW)
"i", which might have underflowed, is passed to "send(spy_socket[sbbs->cfg.node_num - 1], (char *)buf + bufbot, i, 0)".
2844 if (sendsocket(spy_socket[sbbs->cfg.node_num - 1], (char*)buf + bufbot, i) != i && SOCKET_ERRNO != EPIPE)
2845 errprintf(LOG_ERR, WHERE, "%s ERROR %d writing to spy socket", node, SOCKET_ERRNO);
2846 #ifdef __unix__
2847 if (uspy_socket[sbbs->cfg.node_num - 1] != INVALID_SOCKET)
2848 if (sendsocket(uspy_socket[sbbs->cfg.node_num - 1], (char*)buf + bufbot, i) != i)
2849 errprintf(LOG_ERR, WHERE, "%s ERROR %d writing to UNIX spy socket", node, SOCKET_ERRNO);
/main.cpp: 2806 in output_thread(void *)()
2800 }
2801 }
2802 pthread_mutex_unlock(&sbbs->ssh_mutex);
2803 }
2804 else
2805 #endif
CID 651667: (INTEGER_OVERFLOW)
"sendbytes", which might have underflowed, is passed to "send(sbbs->client_socket.operator std::__atomic_base<int>::__int_type(), (char *)buf + bufbot, sendbytes, 0)".
2806 i = sendsocket(sbbs->client_socket, (char*)buf + bufbot, sendbytes);
2807 if (i == SOCKET_ERROR) {
2808 SOCKET sock = sbbs->client_socket.load();
2809 if (SOCKET_ERRNO == ENOTSOCK)
2810 lprintf(LOG_NOTICE, "%04d %s [%s] client socket closed on send", sock, sbbs->client.protocol, sbbs->client_ipaddr);
2811 else if (SOCKET_ERRNO == ECONNRESET)
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit,
https://scan.coverity.com/projects/synchronet?tab=overview
---
* Synchronet * Vertrauen � Home of Synchronet � [vert/cvs/bbs].synchro.net