Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
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
mantidproject
mantid
Commits
c06b0a3e
Commit
c06b0a3e
authored
9 years ago
by
Federico Montesino Pouzols
Browse files
Options
Downloads
Patches
Plain Diff
check size from file used to allocate mem, 1075717, re #13951
parent
ba671c78
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Framework/DataHandling/src/LoadRaw/isisraw2.cpp
+10
-0
10 additions, 0 deletions
Framework/DataHandling/src/LoadRaw/isisraw2.cpp
with
10 additions
and
0 deletions
Framework/DataHandling/src/LoadRaw/isisraw2.cpp
+
10
−
0
View file @
c06b0a3e
...
...
@@ -95,7 +95,17 @@ int ISISRAW2::ioRAW(FILE *file, bool from_file, bool read_data) {
// ISISRAW::ioRAW(file, &u_len, 1, from_file);
if
(
from_file
)
{
u_len
=
add
.
ad_data
-
add
.
ad_user
-
2
;
if
(
u_len
<
0
||
(
add
.
ad_data
<
add
.
ad_user
+
2
))
{
// this will/would be used for memory allocation
g_log
.
error
()
<<
"Error in u_len value read from file, it would be "
<<
u_len
<<
"; where it is calculated as "
"u_len = ad_data - ad_user - 2, where ad_data: "
<<
add
.
ad_data
<<
", ad_user: "
<<
add
.
ad_user
<<
"
\n
"
;
throw
std
::
runtime_error
(
"Inconsistent value for the field u_len found"
);
}
}
ISISRAW
::
ioRAW
(
file
,
&
u_dat
,
u_len
,
from_file
);
ISISRAW
::
ioRAW
(
file
,
&
ver8
,
1
,
from_file
);
fgetpos
(
file
,
&
dhdr_pos
);
...
...
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