Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
c3c68490
Commit
c3c68490
authored
21 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
show_msg() ignores data fields with invalid lengths.
parent
a4d88958
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/getmsg.cpp
+4
-1
4 additions, 1 deletion
src/sbbs3/getmsg.cpp
with
4 additions
and
1 deletion
src/sbbs3/getmsg.cpp
+
4
−
1
View file @
c3c68490
...
@@ -226,6 +226,8 @@ void sbbs_t::show_msg(smbmsg_t* msg, long mode)
...
@@ -226,6 +226,8 @@ void sbbs_t::show_msg(smbmsg_t* msg, long mode)
switch
(
msg
->
dfield
[
i
].
type
)
{
switch
(
msg
->
dfield
[
i
].
type
)
{
case
TEXT_BODY
:
case
TEXT_BODY
:
case
TEXT_TAIL
:
case
TEXT_TAIL
:
if
(
msg
->
dfield
[
i
].
length
<
sizeof
(
xlat
))
/* Invalid length */
continue
;
fseek
(
smb
.
sdt_fp
,
msg
->
hdr
.
offset
+
msg
->
dfield
[
i
].
offset
fseek
(
smb
.
sdt_fp
,
msg
->
hdr
.
offset
+
msg
->
dfield
[
i
].
offset
,
SEEK_SET
);
,
SEEK_SET
);
fread
(
&
xlat
,
sizeof
(
xlat
),
1
,
smb
.
sdt_fp
);
fread
(
&
xlat
,
sizeof
(
xlat
),
1
,
smb
.
sdt_fp
);
...
@@ -262,7 +264,8 @@ void sbbs_t::show_msg(smbmsg_t* msg, long mode)
...
@@ -262,7 +264,8 @@ void sbbs_t::show_msg(smbmsg_t* msg, long mode)
else
else
putmsg_fp
(
smb
.
sdt_fp
,
msg
->
dfield
[
i
].
length
-
sizeof
(
xlat
),
mode
);
putmsg_fp
(
smb
.
sdt_fp
,
msg
->
dfield
[
i
].
length
-
sizeof
(
xlat
),
mode
);
CRLF
;
CRLF
;
break
;
}
break
;
}
}
}
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment