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
7eaf81b6
Commit
7eaf81b6
authored
May 13, 2004
by
rswindell
Browse files
Using SAFECOPY() and sizeof() for proper bounds control (no functional change).
parent
e7bb3a1e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
src/sbbs3/fido.cpp
src/sbbs3/fido.cpp
+7
-7
src/sbbs3/rechocfg.c
src/sbbs3/rechocfg.c
+1
-1
No files found.
src/sbbs3/fido.cpp
View file @
7eaf81b6
...
...
@@ -74,7 +74,7 @@ bool sbbs_t::lookup_netuser(char *into)
if
((
stream
=
fnopen
(
&
i
,
str
,
O_RDONLY
))
==
NULL
)
return
(
false
);
while
(
!
feof
(
stream
))
{
if
(
!
fgets
(
str
,
250
,
stream
))
if
(
!
fgets
(
str
,
sizeof
(
str
)
,
stream
))
break
;
str
[
25
]
=
0
;
truncsp
(
str
);
...
...
@@ -155,7 +155,7 @@ bool sbbs_t::netmail(char *into, char *title, long mode)
memset
(
&
hdr
,
0
,
sizeof
(
hdr
));
/* Initialize header to null */
strcpy
(
hdr
.
from
,
cfg
.
netmail_misc
&
NMAIL_ALIAS
?
useron
.
alias
:
useron
.
name
);
sprintf
(
hdr
.
to
,
"%.35s"
,
to
);
SAFECOPY
(
hdr
.
to
,
to
);
/* Look-up in nodelist? */
...
...
@@ -291,7 +291,7 @@ bool sbbs_t::netmail(char *into, char *title, long mode)
if
(
*
p
==
SP
)
p
++
;
hdr
.
attr
|=
FIDO_FILE
;
}
sprintf
(
hdr
.
subj
,
"%.71s"
,
p
);
SAFECOPY
(
hdr
.
subj
,
p
);
sprintf
(
str
,
"%sNETMAIL.MSG"
,
cfg
.
node_dir
);
if
((
file
=
nopen
(
str
,
O_RDONLY
))
==-
1
)
{
...
...
@@ -383,7 +383,7 @@ bool sbbs_t::netmail(char *into, char *title, long mode)
if
(
p
)
{
addr
=
atofaddr
(
&
cfg
,
p
+
1
);
*
p
=
0
;
sprintf
(
hdr
.
to
,
"%.35s"
,
str
);
}
SAFECOPY
(
hdr
.
to
,
str
);
}
else
{
atofaddr
(
&
cfg
,
str
);
strcpy
(
hdr
.
to
,
"Sysop"
);
}
...
...
@@ -740,9 +740,9 @@ void sbbs_t::qwktonetmail(FILE *rep, char *block, char *into, uchar fromhub)
strcat
(
str
,
tmp
);
}
else
strcpy
(
str
,
cfg
.
netmail_misc
&
NMAIL_ALIAS
?
useron
.
alias
:
useron
.
name
);
sprintf
(
hdr
.
from
,
"%.35s"
,
str
);
SAFECOPY
(
hdr
.
from
,
str
);
sprintf
(
hdr
.
to
,
"%.35s"
,
to
);
SAFECOPY
(
hdr
.
to
,
to
);
/* Look-up in nodelist? */
...
...
@@ -820,7 +820,7 @@ void sbbs_t::qwktonetmail(FILE *rep, char *block, char *into, uchar fromhub)
if
(
*
p
==
SP
)
p
++
;
hdr
.
attr
|=
FIDO_FILE
;
}
sprintf
(
hdr
.
subj
,
"%.71s"
,
p
);
SAFECOPY
(
hdr
.
subj
,
p
);
for
(
i
=
1
;
i
;
i
++
)
{
sprintf
(
str
,
"%s%u.msg"
,
cfg
.
netmail_dir
,
i
);
...
...
src/sbbs3/rechocfg.c
View file @
7eaf81b6
...
...
@@ -583,7 +583,7 @@ void read_echo_cfg()
*
p
=
0
;
++
p
;
while
(
*
p
&&
*
p
<=
SP
)
p
++
;
sprintf
(
cfg
.
listcfg
[
cfg
.
listcfgs
-
1
].
password
,
"%.71s"
,
tp
);
}
}
SAFECOPY
(
cfg
.
listcfg
[
cfg
.
listcfgs
-
1
].
password
,
tp
);
}
}
else
cfg
.
listcfg
[
cfg
.
listcfgs
-
1
].
misc
|=
NOFWD
;
if
(
!*
p
)
...
...
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