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
Compare Revisions
aeecca160d9fec2780fb65136ff5b192c69d5e50...b1bb5630000e4065a9377f1bfaebcf23e6933ccc
Commits (1)
Handle filelength() possibly returning negative value
· b1bb5630
Rob Swindell
authored
Feb 24, 2022
CID 349724
b1bb5630
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/sbbs3/userdat.c
src/sbbs3/userdat.c
+1
-1
No files found.
src/sbbs3/userdat.c
View file @
b1bb5630
...
@@ -1457,7 +1457,7 @@ char* readsmsg(scfg_t* cfg, int usernumber)
...
@@ -1457,7 +1457,7 @@ char* readsmsg(scfg_t* cfg, int usernumber)
if
((
file
=
nopen
(
str
,
O_RDWR
))
==-
1
)
if
((
file
=
nopen
(
str
,
O_RDWR
))
==-
1
)
return
(
NULL
);
return
(
NULL
);
length
=
(
long
)
filelength
(
file
);
length
=
(
long
)
filelength
(
file
);
if
((
buf
=
(
char
*
)
malloc
(
length
+
1
))
==
NULL
)
{
if
(
length
<
0
||
(
buf
=
(
char
*
)
malloc
(
length
+
1
))
==
NULL
)
{
close
(
file
);
close
(
file
);
return
(
NULL
);
return
(
NULL
);
}
}
...
...