----==_mimepart_6abe319fc4e9d_3b64712c3f1480d994457d6
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
Please find the latest report on new defect(s) introduced to Synchronet found with Coverity Scan.
5 new defect(s) introduced to Synchronet found with Coverity Scan.
1 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 5 of 5 defect(s)
** CID 656690: Error handling issues (CHECKED_RETURN)
/websrvr.cpp: 2622 in js_add_cookieval(http_session_t *, const char *, const char *)()
_____________________________________________________________________________________________
*** CID 656690: Error handling issues (CHECKED_RETURN)
/websrvr.cpp: 2622 in js_add_cookieval(http_session_t *, const char *, const char *)()
2616 errprintf(LOG_ERR, WHERE, "%04d %-5s [%s] failed to create JSString for cookie value '%s', key=%s"
2617 , session->socket, session->client.protocol, session->host_ip, value, key);
2618 else {
2619 lprintf(LOG_DEBUG, "%04d %-5s [%s] Adding cookie value %s=%s at pos %d"
2620 , session->socket, session->client.protocol, session->host_ip, key, value, alen);
2621 val = STRING_TO_JSVAL(js_str);
CID 656690: Error handling issues (CHECKED_RETURN)
Calling "JS_SetElement" without checking return value (as is done elsewhere 32 out of 40 times).
2622 JS_SetElement(session->js_cx, keyarray, alen, &val); 2623 }
2624 }
2625
2626 static void js_add_request_property(http_session_t * session, const char *key, const char *value, size_t len, bool writeable)
2627 {
** CID 656689: Error handling issues (CHECKED_RETURN)
/str.cpp: 1190 in sbbs_t::xfer_prot_menu(XFER_TYPE, user_t *, char *, unsigned long, const char *)()
_____________________________________________________________________________________________
*** CID 656689: Error handling issues (CHECKED_RETURN)
/str.cpp: 1190 in sbbs_t::xfer_prot_menu(XFER_TYPE, user_t *, char *, unsigned long, const char *)()
1184 for (int i = 0; i < cfg.total_prots; i++) {
1185 if (available(i) && count + 1 < size)
1186 keys[count++] = cfg.prot[i]->mnemonic; 1187 }
1188 keys[count] = '\0';
1189 if (extra_keys != nullptr)
CID 656689: Error handling issues (CHECKED_RETURN)
Calling "strlcat" without checking return value (as is done elsewhere 29 out of 31 times).
1190 strlcat(keys, extra_keys, size);
1191 set_cmd_keys(keys);
1192 }
1193 if (type == XFER_DOWNLOAD && current_file != nullptr)
1194 menu("download", P_NOERROR);
1195 bool menu_used = menu(prot_menu_file[type], P_NOERROR);
** CID 656688: Memory - corruptions (ARRAY_VS_SINGLETON)
_____________________________________________________________________________________________
*** CID 656688: Memory - corruptions (ARRAY_VS_SINGLETON) /js_console.cpp: 93 in js_key_str(JSContext *, char)()
87 , CON_PROP_OUTPUT_RATE
88 };
89
90 extern JSClass js_console_class;
91 static JSString* js_key_str(JSContext* cx, char key)
92 {
CID 656688: Memory - corruptions (ARRAY_VS_SINGLETON)
Passing "&key" to function "JS_NewStringCopyN" which uses it as an array. This might corrupt or misinterpret adjacent memory locations.
93 return JS_NewStringCopyN(cx, &key, key == 0 ? 0 : 1);
94 }
95
96 static JSBool js_console_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
97 {
98 jsval idval;
** CID 656687: (CHECKED_RETURN)
/qwk.cpp: 456 in sbbs_t::qwk_download()()
/qwk.cpp: 417 in sbbs_t::qwk_download()()
_____________________________________________________________________________________________
*** CID 656687: (CHECKED_RETURN)
/qwk.cpp: 456 in sbbs_t::qwk_download()()
450 }
451 if (!sent) {
452 for (int i = 0; i < cfg.total_subs; i++)
453 subscan[i].ptr = sav_ptr[i];
454 last_ns_time = ns_time;
455 }
CID 656687: (CHECKED_RETURN)
Calling "remove(path)" without checking return value. This library function may fail and return an error code.
456 remove(path);
457 free(sav_ptr);
458 return sent;
459 }
460
461 /****************************************************************************/
/qwk.cpp: 417 in sbbs_t::qwk_download()()
411 return false;
412 }
413 for (int i = 0; i < cfg.total_subs; i++)
414 sav_ptr[i] = subscan[i].ptr;
415 snprintf(path, sizeof path, "%s%s.qwk", cfg.temp_dir, cfg.sys_id);
416 snprintf(fname, sizeof fname, "%s.qwk", cfg.sys_id);
CID 656687: (CHECKED_RETURN)
Calling "remove(path)" without checking return value. This library function may fail and return an error code.
417 remove(path);
418 if (pack_qwk(path, &msgcnt, /* prepack: */ false)) {
419 off_t l = flength(path);
420 bprintf(text[FiFilename], getfname(path));
421 bprintf(text[FiFileSize], u64toac(l, tmp)
422 , byte_estimate_to_str(l, tmp2, sizeof(tmp2), /* units: */ 1024, /* precision: */ 1));
** CID 656686: Error handling issues (CHECKED_RETURN)
/websrvr.cpp: 2584 in js_add_queryval(http_session_t *, const char *, const char *)()
_____________________________________________________________________________________________
*** CID 656686: Error handling issues (CHECKED_RETURN)
/websrvr.cpp: 2584 in js_add_queryval(http_session_t *, const char *, const char *)()
2578 errprintf(LOG_ERR, WHERE, "%04d %-5s [%s] failed to create JSString for query value '%s', key=%s"
2579 , session->socket, session->client.protocol, session->host_ip, value, key);
2580 else {
2581 lprintf(LOG_DEBUG, "%04d %-5s [%s] Adding query value %s=%s at pos %d"
2582 , session->socket, session->client.protocol, session->host_ip, key, value, alen);
2583 val = STRING_TO_JSVAL(js_str);
CID 656686: Error handling issues (CHECKED_RETURN)
Calling "JS_SetElement" without checking return value (as is done elsewhere 32 out of 40 times).
2584 JS_SetElement(session->js_cx, keyarray, alen, &val); 2585 }
2586 }
2587
2588 static void js_add_cookieval(http_session_t * session, const char *key, const char *value)
2589 {
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit,
https://scan.coverity.com/projects/synchronet?tab=overview
----==_mimepart_6abe319fc4e9d_3b64712c3f1480d994457d6
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>New Defects Reported - Synchronet</title>
<style>
body { font-family: Arial, sans-serif; color: #222; line-height: 1.6; }
.button {
display: inline-block;
padding: 10px 20px;
margin: 20px 0;
font-size: 16px;
color: #fff !important;
background-color: #0056b3;
text-decoration: none;
border-radius: 5px;
}
pre {
background: #f8f9fa;
padding: 10px;
border-radius: 5px;
font-size: 14px;
overflow-x: auto;
}
</style>
</head>
<body>
<p>Hi,</p>
<p>
Please find the latest report on new defect(s) introduced to <strong>Synchronet</strong>
found with Coverity Scan.
</p>
<ul>
<li><strong>New Defects Found:</strong> 5</li>
<li>
1 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.
</li>
<li><strong>Defects Shown:</strong> Showing 5 of 5 defect(s)</li>
</ul>
<h3>Defect Details</h3>
<pre>
** CID 656690: Error handling issues (CHECKED_RETURN)
/websrvr.cpp: 2622 in js_add_cookieval(http_session_t *, const char *, const char *)()
_____________________________________________________________________________________________
*** CID 656690: Error handling issues (CHECKED_RETURN)
/websrvr.cpp: 2622 in js_add_cookieval(http_session_t *, const char *, const char *)()
2616 errprintf(LOG_ERR, WHERE, "%04d %-5s [%s] failed to create JSString for cookie value '%s', key=%s"
2617 , session->socket, session->client.protocol, session->host_ip, value, key);
2618 else {
2619 lprintf(LOG_DEBUG, "%04d %-5s [%s] Adding cookie value %s=%s at pos %d"
2620 , session->socket, session->client.protocol, session->host_ip, key, value, alen);
2621 val = STRING_TO_JSVAL(js_str);
>>> CID 656690: Error handling issues (CHECKED_RETURN) >>> Calling "JS_SetElement" without checking return value (as is done elsewhere 32 out of 40 times).
2622 JS_SetElement(session->js_cx, keyarray, alen, &val);
2623 }
2624 }
2625
2626 static void js_add_request_property(http_session_t * session, const char *key, const char *value, size_t len, bool writeable)
2627 {
** CID 656689: Error handling issues (CHECKED_RETURN)
/str.cpp: 1190 in sbbs_t::xfer_prot_menu(XFER_TYPE, user_t *, char *, unsigned long, const char *)()
_____________________________________________________________________________________________
*** CID 656689: Error handling issues (CHECKED_RETURN)
/str.cpp: 1190 in sbbs_t::xfer_prot_menu(XFER_TYPE, user_t *, char *, unsigned long, const char *)()
1184 for (int i = 0; i < cfg.total_prots; i++) {
1185 if (available(i) && count + 1 < size)
1186 keys[count++] = cfg.prot[i]->mnemonic;
1187 }
1188 keys[count] = '\0';
1189 if (extra_keys != nullptr)
>>> CID 656689: Error handling issues (CHECKED_RETURN) >>> Calling "strlcat" without checking return value (as is done elsewhere 29 out of 31 times).
1190 strlcat(keys, extra_keys, size);
1191 set_cmd_keys(keys);
1192 }
1193 if (type == XFER_DOWNLOAD && current_file != nullptr) 1194 menu("download", P_NOERROR);
1195 bool menu_used = menu(prot_menu_file[type], P_NOERROR);
** CID 656688: Memory - corruptions (ARRAY_VS_SINGLETON)
_____________________________________________________________________________________________
*** CID 656688: Memory - corruptions (ARRAY_VS_SINGLETON) /js_console.cpp: 93 in js_key_str(JSContext *, char)()
87 , CON_PROP_OUTPUT_RATE
88 };
89
90 extern JSClass js_console_class;
91 static JSString* js_key_str(JSContext* cx, char key)
92 {
>>> CID 656688: Memory - corruptions (ARRAY_VS_SINGLETON) >>> Passing "&key" to function "JS_NewStringCopyN" which uses it as an array. This might corrupt or misinterpret adjacent memory locations.
93 return JS_NewStringCopyN(cx, &key, key == 0 ? 0 : 1);
94 }
95
96 static JSBool js_console_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
97 {
98 jsval idval;
** CID 656687: (CHECKED_RETURN)
/qwk.cpp: 456 in sbbs_t::qwk_download()()
/qwk.cpp: 417 in sbbs_t::qwk_download()()
_____________________________________________________________________________________________
*** CID 656687: (CHECKED_RETURN)
/qwk.cpp: 456 in sbbs_t::qwk_download()()
450 }
451 if (!sent) {
452 for (int i = 0; i < cfg.total_subs; i++)
453 subscan[i].ptr = sav_ptr[i];
454 last_ns_time = ns_time;
455 }
>>> CID 656687: (CHECKED_RETURN)
>>> Calling "remove(path)" without checking return value. This library function may fail and return an error code.
456 remove(path);
457 free(sav_ptr);
458 return sent;
459 }
460
461 /****************************************************************************/
/qwk.cpp: 417 in sbbs_t::qwk_download()()
411 return false;
412 }
413 for (int i = 0; i < cfg.total_subs; i++)
414 sav_ptr[i] = subscan[i].ptr;
415 snprintf(path, sizeof path, "%s%s.qwk", cfg.temp_dir, cfg.sys_id);
416 snprintf(fname, sizeof fname, "%s.qwk", cfg.sys_id); >>> CID 656687: (CHECKED_RETURN)
>>> Calling "remove(path)" without checking return value. This library function may fail and return an error code.
417 remove(path);
418 if (pack_qwk(path, &msgcnt, /* prepack: */ false)) {
419 off_t l = flength(path);
420 bprintf(text[FiFilename], getfname(path));
421 bprintf(text[FiFileSize], u64toac(l, tmp)
422 , byte_estimate_to_str(l, tmp2, sizeof(tmp2), /* units: */ 1024, /* precision: */ 1));
** CID 656686: Error handling issues (CHECKED_RETURN)
/websrvr.cpp: 2584 in js_add_queryval(http_session_t *, const char *, const char *)()
_____________________________________________________________________________________________
*** CID 656686: Error handling issues (CHECKED_RETURN)
/websrvr.cpp: 2584 in js_add_queryval(http_session_t *, const char *, const char *)()
2578 errprintf(LOG_ERR, WHERE, "%04d %-5s [%s] failed to create JSString for query value '%s', key=%s"
2579 , session->socket, session->client.protocol, session->host_ip, value, key);
2580 else {
2581 lprintf(LOG_DEBUG, "%04d %-5s [%s] Adding query value %s=%s at pos %d"
2582 , session->socket, session->client.protocol, session->host_ip, key, value, alen);
2583 val = STRING_TO_JSVAL(js_str);
>>> CID 656686: Error handling issues (CHECKED_RETURN) >>> Calling "JS_SetElement" without checking return value (as is done elsewhere 32 out of 40 times).
2584 JS_SetElement(session->js_cx, keyarray, alen, &val);
2585 }
2586 }
2587
2588 static void js_add_cookieval(http_session_t * session, const char *key, const char *value)
2589 {
</pre>
<p>
<a href="
https://scan.coverity.com/projects/synchronet?tab=overview" class="button">View Defects in Coverity Scan</a>
</p>
<p>Best regards,</p>
<p>The Coverity Scan Admin Team</p>
<img class="logo" width="140" src="
https://scan.coverity.com/assets/BlackDuckLogo-6697adc63e07340464201a2ad534d3d3e44f95d36edda20b140440d34f05372f.svg" />
</body>
</html>
----==_mimepart_6abe319fc4e9d_3b64712c3f1480d994457d6--
--- SBBSecho 3.38-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)