Subj : New Defects reported by Coverity Scan for Synchronet To : All From : scan-admin@coverity.com Date : Thu Oct 01 2026 10:10:40 ----==_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 New Defects Reported - Synchronet

Hi,

Please find the latest report on new defect(s) introduced to Synchronet found with Coverity Scan.

Defect Details

** 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     {

  

View Defects in Coverity Scan

Best regards,

The Coverity Scan Admin Team

----==_mimepart_6abe319fc4e9d_3b64712c3f1480d994457d6-- --- SBBSecho 3.38-Linux * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705) .