Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Per Cederqvist
lyskom-server-ceder-1616-generations-topgit
Commits
643794ce
Commit
643794ce
authored
Aug 22, 2003
by
Per Cederqvist
Browse files
(l2gi_prev): Don't read memory before the start of an array.
parent
2d7cb21e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/server/local-to-global.c
View file @
643794ce
...
...
@@ -1368,6 +1368,8 @@ l2gi_next(L2g_iterator *l2gi)
const
struct
l2g_block_info
*
binfo
;
int
arrindex
;
assert
(
!
l2gi
->
search_ended
);
l2g
=
l2gi
->
l2g
;
arrindex
=
l2gi
->
arrindex
+
1
;
for
(
binfo
=
l2gi
->
binfo
;
...
...
@@ -1457,11 +1459,12 @@ l2gi_prev(L2g_reverse_iterator *l2gi)
const
struct
l2g_block_info
*
binfo
;
int
arrindex
;
assert
(
!
l2gi
->
search_ended
);
l2g
=
l2gi
->
l2g
;
arrindex
=
l2gi
->
arrindex
-
1
;
for
(
binfo
=
l2gi
->
binfo
;
binfo
>=
l2g
->
blocks
;
--
binfo
,
arrindex
=
binfo
->
first_free
-
1
)
binfo
=
l2gi
->
binfo
;
while
(
1
)
{
for
(;
arrindex
>=
0
;
--
arrindex
)
{
...
...
@@ -1482,10 +1485,16 @@ l2gi_prev(L2g_reverse_iterator *l2gi)
return
;
}
}
}
l2gi
->
search_ended
=
1
;
return
;
if
(
binfo
==
l2g
->
blocks
)
{
l2gi
->
search_ended
=
1
;
return
;
}
--
binfo
;
arrindex
=
binfo
->
first_free
-
1
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment