Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
158b7148
authored
Feb 11, 2016
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mtapi_c: fixed null potential null ptr dereference in id pool
parent
1d169817
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
mtapi_c/src/embb_mtapi_id_pool_t.c
+10
-5
No files found.
mtapi_c/src/embb_mtapi_id_pool_t.c
View file @
158b7148
...
...
@@ -36,14 +36,19 @@ void embb_mtapi_id_pool_initialize(
mtapi_uint_t
capacity
)
{
mtapi_uint_t
ii
;
that
->
capacity
=
capacity
;
that
->
id_buffer
=
(
mtapi_uint_t
*
)
embb_mtapi_alloc_allocate
(
sizeof
(
mtapi_uint_t
)
*
(
capacity
+
1
));
that
->
id_buffer
[
0
]
=
EMBB_MTAPI_IDPOOL_INVALID_ID
;
for
(
ii
=
1
;
ii
<=
capacity
;
ii
++
)
{
that
->
id_buffer
[
ii
]
=
ii
;
if
(
NULL
!=
that
->
id_buffer
)
{
that
->
capacity
=
capacity
;
that
->
id_buffer
[
0
]
=
EMBB_MTAPI_IDPOOL_INVALID_ID
;
for
(
ii
=
1
;
ii
<=
capacity
;
ii
++
)
{
that
->
id_buffer
[
ii
]
=
ii
;
}
that
->
ids_available
=
capacity
;
}
else
{
that
->
capacity
=
0
;
that
->
ids_available
=
0
;
}
that
->
ids_available
=
capacity
;
that
->
put_id_position
=
0
;
that
->
get_id_position
=
1
;
embb_spin_init
(
&
that
->
lock
);
...
...
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