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
b1bb5630
Commit
b1bb5630
authored
Feb 24, 2022
by
Rob Swindell
💬
Browse files
Handle filelength() possibly returning negative value
CID 349724
parent
aeecca16
Pipeline
#2774
passed with stage
in 9 minutes and 18 seconds
Changes
1
Pipelines
1
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)
if
((
file
=
nopen
(
str
,
O_RDWR
))
==-
1
)
return
(
NULL
);
length
=
(
long
)
filelength
(
file
);
if
((
buf
=
(
char
*
)
malloc
(
length
+
1
))
==
NULL
)
{
if
(
length
<
0
||
(
buf
=
(
char
*
)
malloc
(
length
+
1
))
==
NULL
)
{
close
(
file
);
return
(
NULL
);
}
...
...
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