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
1d169817
authored
Feb 11, 2016
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mtapi_c: fixed potential null ptr dereference
parent
df7ba781
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
mtapi_c/src/embb_mtapi_job_t.c
+10
-3
No files found.
mtapi_c/src/embb_mtapi_job_t.c
View file @
1d169817
...
@@ -41,6 +41,9 @@
...
@@ -41,6 +41,9 @@
mtapi_boolean_t
embb_mtapi_job_initialize_list
(
embb_mtapi_node_t
*
node
)
{
mtapi_boolean_t
embb_mtapi_job_initialize_list
(
embb_mtapi_node_t
*
node
)
{
node
->
job_list
=
(
embb_mtapi_job_t
*
)
embb_mtapi_alloc_allocate
(
node
->
job_list
=
(
embb_mtapi_job_t
*
)
embb_mtapi_alloc_allocate
(
sizeof
(
embb_mtapi_job_t
)
*
(
node
->
attributes
.
max_jobs
+
1
));
sizeof
(
embb_mtapi_job_t
)
*
(
node
->
attributes
.
max_jobs
+
1
));
if
(
NULL
==
node
->
job_list
)
{
return
MTAPI_FALSE
;
}
mtapi_uint_t
ii
;
mtapi_uint_t
ii
;
for
(
ii
=
0
;
ii
<=
node
->
attributes
.
max_jobs
;
ii
++
)
{
for
(
ii
=
0
;
ii
<=
node
->
attributes
.
max_jobs
;
ii
++
)
{
embb_mtapi_job_initialize
(
embb_mtapi_job_initialize
(
...
@@ -112,11 +115,15 @@ void embb_mtapi_job_initialize(
...
@@ -112,11 +115,15 @@ void embb_mtapi_job_initialize(
that
->
domain_id
=
0
;
that
->
domain_id
=
0
;
that
->
node_id
=
0
;
that
->
node_id
=
0
;
that
->
num_actions
=
0
;
that
->
num_actions
=
0
;
that
->
max_actions
=
max_actions
;
that
->
actions
=
(
mtapi_action_hndl_t
*
)
that
->
actions
=
(
mtapi_action_hndl_t
*
)
embb_mtapi_alloc_allocate
(
sizeof
(
mtapi_action_hndl_t
)
*
max_actions
);
embb_mtapi_alloc_allocate
(
sizeof
(
mtapi_action_hndl_t
)
*
max_actions
);
for
(
ii
=
0
;
ii
<
max_actions
;
ii
++
)
{
if
(
NULL
!=
that
->
actions
)
{
that
->
actions
[
ii
].
id
=
EMBB_MTAPI_IDPOOL_INVALID_ID
;
that
->
max_actions
=
max_actions
;
for
(
ii
=
0
;
ii
<
max_actions
;
ii
++
)
{
that
->
actions
[
ii
].
id
=
EMBB_MTAPI_IDPOOL_INVALID_ID
;
}
}
else
{
that
->
max_actions
=
0
;
}
}
}
}
...
...
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