Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
634a4e13
Commit
634a4e13
authored
Jul 23, 2010
by
Uwe Schulzweida
Browse files
cdfInqContents: fixed out of bounds access to attstring
parent
cf1c2ee2
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
634a4e13
2010-07-23 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cdfInqContents: fixed out of bounds access to attstring [report: Heiner Widmann]
2010-07-05 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cdfInqContents: fix problem of wrong stdname for grid description [report: Michael Boettinger]
...
...
src/stream_cdf.c
View file @
634a4e13
...
...
@@ -3817,7 +3817,7 @@ int cdfTimeDimID(int fileID, int ndims, int nvars)
cdf_inq_attname
(
fileID
,
varid
,
iatt
,
attname
);
if
(
memcmp
(
attname
,
"units"
,
5
)
==
0
)
{
cdfGetAttText
(
fileID
,
varid
,
"units"
,
256
,
timeunits
);
cdfGetAttText
(
fileID
,
varid
,
"units"
,
sizeof
(
timeunits
)
,
timeunits
);
strtolower
(
timeunits
);
if
(
memcmp
(
timeunits
,
"sec"
,
3
)
==
0
||
...
...
@@ -4713,7 +4713,6 @@ int cdfInqContents(int streamID)
if
(
xtype
==
NC_CHAR
)
{
cdfGetAttText
(
fileID
,
NC_GLOBAL
,
attname
,
attstringlen
-
1
,
attstring
);
attstring
[
attlen
+
1
]
=
0
;
if
(
attlen
>
0
&&
attstring
[
0
]
!=
0
)
{
...
...
@@ -5940,7 +5939,7 @@ int cdfInqContents(int streamID)
else
if
(
attrtype
==
NC_CHAR
)
{
cdfGetAttText
(
fileID
,
ncvarid
,
attname
,
attstringlen
-
1
,
attstring
);
att
string
[
attlen
]
=
0
;
att
len
=
1
+
strlen
(
attstring
)
;
vlistDefAttTxt
(
vlistID
,
varID
,
attname
,
(
int
)
attlen
,
attstring
);
if
(
CDI_Debug
)
printf
(
"txt: %s.%s = %s
\n
"
,
ncvars
[
ncvarid
].
name
,
attname
,
attstring
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment