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
a73c0397
Commit
a73c0397
authored
Mar 04, 2008
by
Uwe Schulzweida
Browse files
vlist_att.find_att: allocate attribute only if size > 0
parent
d020b9f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
a73c0397
...
...
@@ -3,6 +3,7 @@
* cdfInqContents: bug fix for inconsistent curvilinear grid [report: Holger Goettel]
* cdfInqContents: check type of _FillValue
* gridCompare: compare grid.yinc only if set
* vlist_att.find_att: allocate attribute only if size > 0
* grid_check_cyclic: bug fix
* Version 1.1.1 released
...
...
src/vlist_att.c
View file @
a73c0397
...
...
@@ -92,8 +92,11 @@ void fill_att(CDI_att *attp, int type, size_t nelems, size_t xsz, const void *xv
attp
->
type
=
type
;
attp
->
nelems
=
nelems
;
attp
->
xvalue
=
(
void
*
)
malloc
(
xsz
);
memcpy
(
attp
->
xvalue
,
xvalue
,
xsz
);
if
(
xsz
>
0
)
{
attp
->
xvalue
=
(
void
*
)
malloc
(
xsz
);
memcpy
(
attp
->
xvalue
,
xvalue
,
xsz
);
}
}
...
...
@@ -246,7 +249,8 @@ int vlist_inq_att(int type, int vlistID, int varID, const char *name, size_t mxs
{
xsz
=
attp
->
xsz
;
if
(
mxsz
<
xsz
)
xsz
=
mxsz
;
memcpy
(
xp
,
attp
->
xvalue
,
xsz
);
if
(
xsz
>
0
)
memcpy
(
xp
,
attp
->
xvalue
,
xsz
);
}
else
{
...
...
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