Subj : New Defects reported by Coverity Scan for Synchronet To : All From : scan-admin@coverity.com Date : Mon Sep 01 2025 03:04:51 ----==_mimepart_68b50d534c480_2468dc2e83776d99ac35483 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. 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 584833: Error handling issues (CHECKED_RETURN) _____________________________________________________________________________________________ *** CID 584833: Error handling issues (CHECKED_RETURN) /mailsrvr.c: 2877 in archive_mail() 2871 bool archive_mail(const char* fname, int usernumber, const char* subdir, const char* session_id) 2872 { 2873 char tmp[128]; 2874 char path[MAX_PATH + 1]; 2875 2876 snprintf(path, sizeof path, "%suser/%04u/%s/", scfg.data_dir, usernumber, subdir); >>> CID 584833: Error handling issues (CHECKED_RETURN) >>> Calling "mkpath(path)" without checking return value. It wraps a library function that may fail and return an error code. 2877 mkpath(path); 2878 SAFECAT(path, gmtime_to_isoDateTimeStr(time(NULL), tmp, sizeof tmp)); 2879 SAFECAT(path, "-"); 2880 SAFECAT(path, session_id); 2881 SAFECAT(path, ".eml"); 2882 return CopyFile(fname, path, /* fail-if-exists: */true); ________________________________________________________________________________________________________ To view the defects in Coverity Scan visit, https://scan.coverity.com/projects/synchronet?tab=overview ----==_mimepart_68b50d534c480_2468dc2e83776d99ac35483 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 584833:       Error handling issues  (CHECKED_RETURN)


_____________________________________________________________________________________________
*** CID 584833:         Error handling issues  (CHECKED_RETURN)
/mailsrvr.c: 2877             in archive_mail()
2871     bool archive_mail(const char* fname, int usernumber, const char* subdir, const char* session_id)
2872     {
2873     	char tmp[128];
2874     	char path[MAX_PATH + 1];
2875
2876     	snprintf(path, sizeof path, "%suser/%04u/%s/", scfg.data_dir, usernumber, subdir);
>>>     CID 584833:         Error handling issues  (CHECKED_RETURN)
>>>     Calling "mkpath(path)" without checking return value. It wraps a library function that may fail and return an error code.
2877     	mkpath(path);
2878     	SAFECAT(path, gmtime_to_isoDateTimeStr(time(NULL), tmp, sizeof tmp));
2879     	SAFECAT(path, "-");
2880     	SAFECAT(path, session_id);
2881     	SAFECAT(path, ".eml");
2882     	return CopyFile(fname, path, /* fail-if-exists: */true);

  

View Defects in Coverity Scan

Best regards,

The Coverity Scan Admin Team

----==_mimepart_68b50d534c480_2468dc2e83776d99ac35483-- --- þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net .