• New Defects reported by Coverity Scan for Synchronet

    From scan-admin@coverity.com@VERT to All on Fri Jun 26 12:49:28 2026
    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.
    2 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 1 of 1 defect(s)


    ** CID 647057: High impact quality (Y2K38_SAFETY)
    /mime.c: 43 in mimegetboundary()


    _____________________________________________________________________________________________
    *** CID 647057: High impact quality (Y2K38_SAFETY)
    /mime.c: 43 in mimegetboundary()
    37 int i, num;
    38 char* boundaryString = (char*)malloc(SIZEOF_MIMEBOUNDARY + 1);
    39
    40 /* A nonzero seed yields a deterministic boundary, so a message rendered
    41 * more than once (e.g. the DKIM sign/send two-pass) gets an identical 42 * boundary both times; seed==0 preserves the original time-seeded behavior. */
    CID 647057: High impact quality (Y2K38_SAFETY)
    A "time_t" value is stored in an integer with too few bits to accommodate it. The expression "time(NULL)" is cast to "unsigned int".
    43 srand(seed != 0 ? seed : (unsigned int)time(NULL));
    44 if (boundaryString == NULL)
    45 return NULL;
    46 for (i = 0; i < SIZEOF_MIMEBOUNDARY; i++) {
    47 num = (rand() % 62);
    48 if (num < 10)


    ________________________________________________________________________________________________________
    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
  • From scan-admin@coverity.com@VERT to All on Tue Jun 30 12:45:51 2026
    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 647297: Concurrent data access violations (MISSING_LOCK) /tmp/sbbs-Jun-30-2026/src/conio/key.c: 34 in ciokey_init()


    _____________________________________________________________________________________________
    *** CID 647297: Concurrent data access violations (MISSING_LOCK) /tmp/sbbs-Jun-30-2026/src/conio/key.c: 34 in ciokey_init()
    28 static pthread_once_t ciokey_initialized = PTHREAD_ONCE_INIT;
    29
    30 static void
    31 ciokey_init(void)
    32 {
    33 memset(&state, 0, sizeof(state));
    CID 647297: Concurrent data access violations (MISSING_LOCK) >>> Accessing "state.events" without holding lock "ciokey_state.mutex". Elsewhere, "ciokey_state.events" is written to with "ciokey_state.mutex" held 6 out of 8 times.
    34 listInit(&state.events, 0);
    35 assert_pthread_mutex_init(&state.mutex, NULL);
    36 state.wake_event = CreateEvent(NULL, FALSE, FALSE, NULL);
    37 }
    38
    39 static void


    ________________________________________________________________________________________________________
    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
  • From scan-admin@coverity.com@VERT to All on Mon Jul 6 12:49:33 2026
    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.
    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 1 of 1 defect(s)


    ** CID 648908: Resource leaks (RESOURCE_LEAK)
    /prntfile.cpp: 747 in sbbs_t::menu_exists_in(const char *, const char *, const char *, bool, char *)()


    _____________________________________________________________________________________________
    *** CID 648908: Resource leaks (RESOURCE_LEAK)
    /prntfile.cpp: 747 in sbbs_t::menu_exists_in(const char *, const char *, const char *, bool, char *)()
    741 if (*code == '.')
    742 *sub = '\0';
    743 if (mods)
    744 SAFEPRINTF3(prefix, "%stext/menu/%s%s", cfg.mods_dir, sub, code);
    745 else
    746 SAFEPRINTF3(prefix, "%smenu/%s%s", cfg.text_dir, sub, code);
    CID 648908: Resource leaks (RESOURCE_LEAK)
    Ignoring storage allocated by "_fullpath(path, prefix, 4096UL)" leaks it.
    747 FULLPATH(path, prefix, MAX_PATH);
    748 SAFECOPY(prefix, path);
    749 }
    750 // Display specified EXACT width file
    751 safe_snprintf(path, MAX_PATH, "%s.%ucol.%s", prefix, term->cols, ext);
    752 if (fexistcase(path))


    ________________________________________________________________________________________________________
    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
  • From scan-admin@coverity.com@VERT to cov-scan@synchro.net on Thu Jul 23 12:50:43 2026
    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
  • From scan-admin@coverity.com@VERT to cov-scan@synchro.net on Tue Jul 28 21:16:18 2026
    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.
    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 1 of 1 defect(s)


    ** CID 651709: Resource leaks (RESOURCE_LEAK)
    /useredit.cpp: 108 in sbbs_t::useredit(int)()


    _____________________________________________________________________________________________
    *** CID 651709: Resource leaks (RESOURCE_LEAK)
    /useredit.cpp: 108 in sbbs_t::useredit(int)()
    102 if (user.comment[0] || i)
    103 bprintf(text[UeditCommentLine], i ? '+' : ' ' 104 , user.comment);
    105 else
    106 term->newline();
    107 if (localtime32(&user.laston, &tm) == NULL)
    CID 651709: Resource leaks (RESOURCE_LEAK)
    Variable "find_expr" going out of scope leaks the storage it points to. 108 return;
    109 bprintf(text[UserDates]
    110 , datestr(user.firston, str), datestr(user.expire, tmp)
    111 , datestr(user.laston, tmp2), tm.tm_hour, tm.tm_min);
    112
    113 bprintf(text[UserTimes]


    ________________________________________________________________________________________________________
    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
  • From scan-admin@coverity.com@VERT to cov-scan@synchro.net on Mon Aug 10 13:31:15 2026
    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.
    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 1 of 1 defect(s)


    ** CID 652885: Integer handling issues (INTEGER_OVERFLOW)
    /useredit.cpp: 167 in sbbs_t::useredit(int)()


    _____________________________________________________________________________________________
    *** CID 652885: Integer handling issues (INTEGER_OVERFLOW) /useredit.cpp: 167 in sbbs_t::useredit(int)()
    161 bprintf(text[UeditPrompt], user.number, l);
    162 SAFEPRINTF4(str, "QG[]?/{}()%c%c%c%c", TERM_KEY_LEFT, TERM_KEY_RIGHT, TERM_KEY_HOME, TERM_KEY_END);
    163 if (user.level <= useron.level)
    164 SAFECAT(str, "ABCDEFHIJKLMNOPRSTUVWXYZ+~*$#"); 165 l = getkeys(str, l, K_UPPER | K_NOCRLF);
    166 if (l & 0x80000000L) {
    CID 652885: Integer handling issues (INTEGER_OVERFLOW)
    Expression "user.number", where "l & 0xffffffff7fffffffL" is known to be equal to -2147483649, overflows the type of "user.number", which is type "int".
    167 user.number = l & ~0x80000000L;
    168 continue;
    169 }
    170 if (IS_ALPHA(l) || strchr("~+*$/", l) != NULL) // non-alpha commands that prompt
    171 term->newline();
    172 switch (l) {


    ________________________________________________________________________________________________________
    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
  • From scan-admin@coverity.com@VERT to All on Thu Aug 20 12:49:16 2026
    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.
    2 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 1 of 1 defect(s)


    ** CID 653403: Insecure data handling (INTEGER_OVERFLOW)
    /userdat.c: 214 in total_users()


    _____________________________________________________________________________________________
    *** CID 653403: Insecure data handling (INTEGER_OVERFLOW)
    /userdat.c: 214 in total_users()
    208 lock is a synchronous round-trip that dominates the cost of this scan
    209 when the data directory is network-mounted, and no amount of locking
    210 makes the result more current than the snapshot it already is. */
    211 do {
    212 got = 0;
    213 while (got < bufsize) {
    CID 653403: Insecure data handling (INTEGER_OVERFLOW)
    "64000UL - got", which might have underflowed, is passed to "read(file, buf + got, 64000UL - got)".
    214 ssize_t rd = read(file, buf + got, bufsize - got);
    215 if (rd <= 0)
    216 break;
    217 got += (size_t)rd;
    218 }
    219 for (size_t offset = 0; offset + USER_RECORD_LINE_LEN <= got; offset += USER_RECORD_LINE_LEN) {


    ________________________________________________________________________________________________________
    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
  • From scan-admin@coverity.com@VERT to All on Sun Aug 30 12:51:09 2026
    Hi,

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

    3 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 3 of 3 defect(s)


    ** CID 654570: (CHECKED_RETURN)
    /xtrn_sec.cpp: 1223 in sbbs_t::xtrndat(const char *, const char *, unsigned char, unsigned int, unsigned int)()
    /xtrn_sec.cpp: 1213 in sbbs_t::xtrndat(const char *, const char *, unsigned char, unsigned int, unsigned int)()


    _____________________________________________________________________________________________
    *** CID 654570: (CHECKED_RETURN)
    /xtrn_sec.cpp: 1223 in sbbs_t::xtrndat(const char *, const char *, unsigned char, unsigned int, unsigned int)()
    1217 int chmod_result = CHMOD(str, _S_IREAD);
    1218 #else
    1219 int chmod_result = CHMOD(str, S_IRUSR);
    1220 #endif
    1221 if (chmod_result != 0) {
    1222 errormsg(WHERE, ERR_WRITE, str, errno);
    CID 654570: (CHECKED_RETURN)
    Calling "remove(str)" without checking return value. This library function may fail and return an error code.
    1223 remove(str);
    1224 return false;
    1225 }
    1226 }
    1227
    1228 else if (type)
    /xtrn_sec.cpp: 1213 in sbbs_t::xtrndat(const char *, const char *, unsigned char, unsigned int, unsigned int)()
    1207 }
    1208 bool write_ok = bbsdev_write(fp, lines, sizeof(lines) / sizeof(lines[0]));
    1209 if (fclose(fp) != 0)
    1210 write_ok = false;
    1211 if (!write_ok) {
    1212 errormsg(WHERE, ERR_WRITE, str, 0);
    CID 654570: (CHECKED_RETURN)
    Calling "remove(str)" without checking return value. This library function may fail and return an error code.
    1213 remove(str);
    1214 return false;
    1215 }
    1216 #if defined(_WIN32)
    1217 int chmod_result = CHMOD(str, _S_IREAD);
    1218 #else

    ** CID 654569: Memory - illegal accesses (OVERRUN)
    /xtrn_sec.cpp: 101 in bbsdev_language_tag_valid(const char *)()


    _____________________________________________________________________________________________
    *** CID 654569: Memory - illegal accesses (OVERRUN)
    /xtrn_sec.cpp: 101 in bbsdev_language_tag_valid(const char *)()
    95 || (lengths[at] == 4 && isdigit((unsigned char)parts[at][0])
    96 && bbsdev_subtag_chars(parts[at] + 1, 3, isalnum))))
    97 at++;
    98 while (at < count && lengths[at] == 1
    99 && tolower((unsigned char)parts[at][0]) != 'x') {
    100 at++;
    CID 654569: Memory - illegal accesses (OVERRUN)
    Overrunning array "lengths" of 32 8-byte elements at element index 32 (byte offset 263) using index "at" (which evaluates to 32).
    101 if (at == count || lengths[at] < 2)
    102 return false;
    103 while (at < count && lengths[at] >= 2)
    104 at++;
    105 }
    106 if (at < count && lengths[at] == 1 && tolower((unsigned char)parts[at][0]) == 'x')

    ** CID 654568: (RESOURCE_LEAK)
    /xtrn.cpp: 1925 in sbbs_t::external(const char *, int, const char *, const char *)()
    /xtrn.cpp: 1925 in sbbs_t::external(const char *, int, const char *, const char *)()


    _____________________________________________________________________________________________
    *** CID 654568: (RESOURCE_LEAK)
    /xtrn.cpp: 1925 in sbbs_t::external(const char *, int, const char *, const char *)()
    1919 dup2(fd, STDOUT_FILENO);
    1920 if (!(mode & EX_NOLOG))
    1921 dup2(fd, STDERR_FILENO);
    1922 if (fd > 2)
    1923 close(fd);
    1924 }
    CID 654568: (RESOURCE_LEAK)
    Handle variable "fd" going out of scope leaks the handle.
    1925 }
    1926
    1927 if (mode & EX_BG) /* background execution, detach child */
    1928 {
    1929 if (daemon(TRUE, FALSE) != 0)
    1930 lprintf(LOG_ERR, "!ERROR %d (%s) daemonizing: %s", errno, strerror(errno), argv[0]);
    /xtrn.cpp: 1925 in sbbs_t::external(const char *, int, const char *, const char *)()
    1919 dup2(fd, STDOUT_FILENO);
    1920 if (!(mode & EX_NOLOG))
    1921 dup2(fd, STDERR_FILENO);
    1922 if (fd > 2)
    1923 close(fd);
    1924 }
    CID 654568: (RESOURCE_LEAK)
    Handle variable "fd" going out of scope leaks the handle.
    1925 }
    1926
    1927 if (mode & EX_BG) /* background execution, detach child */
    1928 {
    1929 if (daemon(TRUE, FALSE) != 0)
    1930 lprintf(LOG_ERR, "!ERROR %d (%s) daemonizing: %s", errno, strerror(errno), argv[0]);


    ________________________________________________________________________________________________________
    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