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
71ec7b10
Commit
71ec7b10
authored
Nov 16, 2000
by
rswindell
Browse files
getusrsubs and getusrdirs would dereference a NULL pointer if cfg.total_grps or total_libs was 0.
parent
4f3c10fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
src/sbbs3/chk_ar.cpp
src/sbbs3/chk_ar.cpp
+12
-4
No files found.
src/sbbs3/chk_ar.cpp
View file @
71ec7b10
...
...
@@ -521,12 +521,16 @@ void sbbs_t::getusrsubs()
if
(
cfg
.
sub
[
l
]
->
grp
!=
i
)
continue
;
if
(
!
chk_ar
(
cfg
.
sub
[
l
]
->
ar
,
&
useron
))
continue
;
usrsub
[
j
][
k
++
]
=
l
;
}
usrsub
[
j
][
k
++
]
=
l
;
}
usrsubs
[
j
]
=
k
;
if
(
!
k
)
/* No subs accessible in group */
continue
;
usrgrp
[
j
++
]
=
i
;
}
usrgrp
[
j
++
]
=
i
;
}
usrgrps
=
j
;
if
(
usrgrps
==
0
)
return
;
while
((
curgrp
>=
usrgrps
||
!
usrsubs
[
curgrp
])
&&
curgrp
)
curgrp
--
;
while
(
cursub
[
curgrp
]
>=
usrsubs
[
curgrp
]
&&
cursub
[
curgrp
])
cursub
[
curgrp
]
--
;
}
...
...
@@ -541,7 +545,8 @@ void sbbs_t::getusrdirs()
if
(
useron
.
rest
&
FLAG
(
'T'
))
{
usrlibs
=
0
;
return
;
}
return
;
}
for
(
j
=
0
,
i
=
0
;
i
<
cfg
.
total_libs
;
i
++
)
{
if
(
!
chk_ar
(
cfg
.
lib
[
i
]
->
ar
,
&
useron
))
continue
;
...
...
@@ -553,8 +558,11 @@ void sbbs_t::getusrdirs()
usrdirs
[
j
]
=
k
;
if
(
!
k
)
/* No dirs accessible in lib */
continue
;
usrlib
[
j
++
]
=
i
;
}
usrlib
[
j
++
]
=
i
;
}
usrlibs
=
j
;
if
(
usrlibs
==
0
)
return
;
while
((
curlib
>=
usrlibs
||
!
usrdirs
[
curlib
])
&&
curlib
)
curlib
--
;
while
(
curdir
[
curlib
]
>=
usrdirs
[
curlib
]
&&
curdir
[
curlib
])
curdir
[
curlib
]
--
;
}
...
...
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