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
b47b97c2
Commit
b47b97c2
authored
Mar 02, 2022
by
Rob Swindell
💬
Browse files
Detect smb_[f]allocdat() failure in editmsg()
CID 319091
parent
41ce191d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
src/sbbs3/writemsg.cpp
src/sbbs3/writemsg.cpp
+6
-0
No files found.
src/sbbs3/writemsg.cpp
View file @
b47b97c2
...
...
@@ -1681,6 +1681,12 @@ bool sbbs_t::editmsg(smb_t* smb, smbmsg_t *msg)
smb_close_da
(
smb
);
}
if
(
offset
<
0
)
{
smb_unlocksmbhdr
(
smb
);
errormsg
(
WHERE
,
ERR_ALLOC
,
msgtmp
,
length
);
return
false
;
}
msg
->
hdr
.
offset
=
(
uint32_t
)
offset
;
if
((
file
=
open
(
msgtmp
,
O_RDONLY
|
O_BINARY
))
==-
1
||
(
instream
=
fdopen
(
file
,
"rb"
))
==
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