Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
087508b4
Commit
087508b4
authored
Mar 02, 2022
by
Rob Swindell
💬
Browse files
Address Coverity issue: filelength() can return negative value
parent
045feda8
Pipeline
#2827
passed with stage
in 9 minutes and 39 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
18 deletions
+2
-18
src/sbbs3/getnode.cpp
src/sbbs3/getnode.cpp
+1
-17
src/sbbs3/str.cpp
src/sbbs3/str.cpp
+1
-1
No files found.
src/sbbs3/getnode.cpp
View file @
087508b4
/* getnode.cpp */
/* Synchronet node information retrieval functions */
/* $Id: getnode.cpp,v 1.56 2020/08/01 22:04:03 rswindell Exp $ */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
...
...
@@ -17,21 +13,9 @@
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
...
...
@@ -257,7 +241,7 @@ int sbbs_t::getnmsg(bool clearline)
return
(
errno
);
}
length
=
(
long
)
filelength
(
file
);
if
(
!
length
)
{
if
(
length
<=
0
)
{
close
(
file
);
return
(
0
);
}
...
...
src/sbbs3/str.cpp
View file @
087508b4
...
...
@@ -457,7 +457,7 @@ void sbbs_t::read_sif_dat(char *siffile, char *datfile)
return
;
}
length
=
(
long
)
filelength
(
file
);
if
(
!
length
)
{
if
(
length
<=
0
)
{
close
(
file
);
return
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment