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
9 years ago
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mtapi_c: fixed potential null ptr dereference
parent
df7ba781
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
+8
-1
mtapi_c/src/embb_mtapi_job_t.c
+8
-1
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,12 +115,16 @@ void embb_mtapi_job_initialize(
...
@@ -112,12 +115,16 @@ 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
);
if
(
NULL
!=
that
->
actions
)
{
that
->
max_actions
=
max_actions
;
for
(
ii
=
0
;
ii
<
max_actions
;
ii
++
)
{
for
(
ii
=
0
;
ii
<
max_actions
;
ii
++
)
{
that
->
actions
[
ii
].
id
=
EMBB_MTAPI_IDPOOL_INVALID_ID
;
that
->
actions
[
ii
].
id
=
EMBB_MTAPI_IDPOOL_INVALID_ID
;
}
}
}
else
{
that
->
max_actions
=
0
;
}
}
}
void
embb_mtapi_job_finalize
(
embb_mtapi_job_t
*
that
)
{
void
embb_mtapi_job_finalize
(
embb_mtapi_job_t
*
that
)
{
...
...
This diff is collapsed.
Click to expand it.
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