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
9ae5d681
Commit
9ae5d681
authored
Apr 04, 2021
by
Rob Swindell
💬
Browse files
The QWK reset sub ptr command would never work
Caught by Coverity-scan CID 33178
parent
489267ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
src/sbbs3/qwk.cpp
src/sbbs3/qwk.cpp
+7
-4
No files found.
src/sbbs3/qwk.cpp
View file @
9ae5d681
...
...
@@ -689,6 +689,11 @@ void sbbs_t::qwksetptr(uint subnum, char *buf, int reset)
long
l
;
uint32_t
last
;
if
(
reset
&&
!
IS_DIGIT
(
*
buf
))
{
getlastmsg
(
subnum
,
&
(
subscan
[
subnum
].
ptr
),
/* time_t* */
NULL
);
return
;
}
if
(
buf
[
2
]
==
'/'
&&
buf
[
5
]
==
'/'
)
{
/* date specified */
time_t
t
=
dstrtounix
(
&
cfg
,
buf
);
subscan
[
subnum
].
ptr
=
getmsgnum
(
subnum
,
t
);
...
...
@@ -697,15 +702,13 @@ void sbbs_t::qwksetptr(uint subnum, char *buf, int reset)
l
=
atol
(
buf
);
if
(
l
>=
0
)
/* ptr specified */
subscan
[
subnum
].
ptr
=
l
;
else
if
(
l
)
{
/* relative ptr specified */
else
{
/* relative
(to last msg)
ptr specified */
getlastmsg
(
subnum
,
&
last
,
/* time_t* */
NULL
);
if
(
-
l
>
(
long
)
last
)
subscan
[
subnum
].
ptr
=
0
;
else
subscan
[
subnum
].
ptr
=
last
+
l
;
}
else
if
(
reset
)
getlastmsg
(
subnum
,
&
(
subscan
[
subnum
].
ptr
),
/* time_t* */
NULL
);
}
...
...
@@ -774,7 +777,7 @@ void sbbs_t::qwkcfgline(char *buf,uint subnum)
qwksetptr
(
subnum
,
str
+
7
,
1
);
return
;
}
}
}
if
(
!
strncmp
(
str
,
"RESETALL "
,
9
))
{
/* set all ptrs */
for
(
x
=
y
=
0
;
x
<
usrgrps
;
x
++
)
...
...
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