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
160606e4
Commit
160606e4
authored
Feb 22, 2021
by
Rob Swindell
💬
Browse files
Print error and return NULL from getfmsg() upon ftell error
Caught by Coverity - ftell[o] can return negative.
parent
d8f994cd
Pipeline
#1394
passed with stage
in 11 minutes and 36 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
src/sbbs3/sbbsecho.c
src/sbbs3/sbbsecho.c
+4
-0
No files found.
src/sbbs3/sbbsecho.c
View file @
160606e4
...
...
@@ -3224,6 +3224,10 @@ char* getfmsg(FILE* stream, ulong* outlen)
length
=
0L
;
start
=
ftello
(
stream
);
/* Beginning of Message */
if
(
start
<
0
)
{
lprintf
(
LOG_ERR
,
"ERROR %d line %d getting file offset"
,
errno
,
__LINE__
);
return
NULL
;
}
while
(
1
)
{
ch
=
fgetc
(
stream
);
/* Look for Terminating NULL */
if
(
ch
==
0
||
ch
==
EOF
)
/* Found end of message */
...
...
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