Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eformat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
atlas-tdaq-software
eformat
Commits
80c2c8c6
Commit
80c2c8c6
authored
2 years ago
by
Wainer Vandelli
Browse files
Options
Downloads
Patches
Plain Diff
Add checks on the available ROD data before access
parent
9b9f6c52
No related branches found
No related tags found
No related merge requests found
Pipeline
#3840369
passed
2 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ROBFragmentNoTemplates.cxx
+15
-3
15 additions, 3 deletions
src/ROBFragmentNoTemplates.cxx
with
15 additions
and
3 deletions
src/ROBFragmentNoTemplates.cxx
+
15
−
3
View file @
80c2c8c6
...
...
@@ -75,7 +75,6 @@ eformat::read::ROBFragment::check_rob_impl (const uint16_t version,
if
(
exc
)
throw
ex
;
result
=
false
;
}
return
result
;
}
...
...
@@ -98,12 +97,18 @@ eformat::read::ROBFragment::check_rod_impl (const uint16_t version,
bool
result
=
true
;
try
{
if
(
rod_version
()
>>
16
!=
version
)
{
throw
EFORMAT_BAD_ROD_VERSION
(
rod_version
()
>>
16
,
version
);
//First check there at least enough ROD data to check the next field
if
(
payload_size_word
()
<
2
){
throw
EFORMAT_ROD_SIZE_CHECK
(
2
,
payload_size_word
());
}
if
(
rod_header_size_word
()
!=
9
)
{
throw
EFORMAT_SIZE_CHECK
(
9
,
rod_header_size_word
());
}
if
(
rod_version
()
>>
16
!=
version
)
{
throw
EFORMAT_BAD_ROD_VERSION
(
rod_version
()
>>
16
,
version
);
}
if
(
rod_fragment_size_word
()
!=
12
+
rod_nstatus
()
+
rod_ndata
()
)
{
throw
EFORMAT_ROD_SIZE_CHECK
(
rod_fragment_size_word
(),
(
12
+
rod_nstatus
()
+
rod_ndata
()));
...
...
@@ -174,6 +179,13 @@ void eformat::read::ROBFragment::rod_problems
(
std
::
vector
<
eformat
::
FragmentProblem
>&
p
,
const
uint16_t
version
)
const
{
//ROD stuff
if
(
payload_size_word
()
<
3
)
{
// The ROD fragment is smaller than the header size, it is not safe to
// try to access the fields below, we skip the following checks
p
.
push_back
(
eformat
::
WRONG_ROD_FRAGMENT_SIZE
);
return
;
}
if
(
rod_marker
()
!=
eformat
::
ROD
)
p
.
push_back
(
eformat
::
WRONG_ROD_MARKER
);
if
(
rod_version
()
>>
16
!=
version
)
p
.
push_back
(
eformat
::
UNSUPPORTED_ROD_VERSION
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment