Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
5f6a7599
Commit
5f6a7599
authored
Apr 25, 2018
by
Uwe Schulzweida
Browse files
gribapiDefDateTimeRel: check range of endStep (bug fix).
parent
2b7df291
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
5f6a7599
...
...
@@ -2,6 +2,10 @@
* Version 1.9.4 released
2018-04-25 Uwe Schulzweida
* gribapiDefDateTimeRel: check range of endStep (bug fix)
2018-04-03 Uwe Schulzweida
* Added streamReadVarPart() and streamReadVarSlicePart() [patch from: Niklas Rber]
...
...
src/stream_gribapi.c
View file @
5f6a7599
...
...
@@ -1817,7 +1817,9 @@ int gribapiDefDateTimeRel(int editionNumber, grib_handle *gh, int rdate, int rti
gribapiDefStepUnits
(
editionNumber
,
gh
,
timeunit
,
proDefTempNum
,
gcinit
);
long
startStep
=
0
;
long
endStep
=
(
long
)
((
days
*
86400
.
0
+
secs
)
/
factor
);
double
endStepF
=
(
days
*
86400
.
0
+
secs
)
/
factor
;
if
(
endStepF
>
INT_MAX
)
return
status
;
long
endStep
=
(
long
)
endStepF
;
if
(
editionNumber
>
1
)
GRIB_CHECK
(
my_grib_set_long
(
gh
,
"significanceOfReferenceTime"
,
1
),
0
);
if
(
editionNumber
>
1
)
GRIB_CHECK
(
my_grib_set_long
(
gh
,
"stepRange"
,
0
),
0
);
...
...
@@ -1870,8 +1872,8 @@ void gribapiDefTime(int editionNumber, int productDefinitionTemplate, int typeOf
int
rtime
=
taxisInqRtime
(
taxisID
);
int
timeunit
=
taxisInqTunit
(
taxisID
);
int
status
=
gribapiDefDateTimeRel
(
editionNumber
,
gh
,
rdate
,
rtime
,
vdate
,
vtime
,
productDefinitionTemplate
,
typeOfGeneratingProcess
,
tsteptype
,
timeunit
,
calendar
,
gcinit
);
int
status
=
gribapiDefDateTimeRel
(
editionNumber
,
gh
,
rdate
,
rtime
,
vdate
,
vtime
,
productDefinitionTemplate
,
typeOfGeneratingProcess
,
tsteptype
,
timeunit
,
calendar
,
gcinit
);
if
(
status
!=
0
)
taxistype
=
TAXIS_ABSOLUTE
;
}
...
...
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