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
2793dd54
Commit
2793dd54
authored
Dec 10, 2014
by
Uwe Schulzweida
Browse files
vlistDefAttXXX: limit length of attribute name to CDI_MAX_NAME
parent
502ce990
Changes
3
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
2793dd54
2014-12-1
4
Uwe Schulzweida
2014-12-1
1
Uwe Schulzweida
* Version 1.6.7 released
2014-12-10 Uwe Schulzweida
* vlistDefAttXXX: limit length of attribute name to CDI_MAX_NAME
2014-12-05 Uwe Schulzweida
* netCDF absolute time axis with units month: change day from 00 to 01
...
...
src/cdi_int.h
View file @
2793dd54
...
...
@@ -67,7 +67,6 @@ char *strdup(const char *s);
#include "cdi.h"
#define check_parg(arg) if ( arg == 0 ) Warning("Argument '" #arg "' not allocated!")
#if defined (__xlC__)
/* performance problems on IBM */
...
...
src/vlist_att.c
View file @
2793dd54
...
...
@@ -41,13 +41,13 @@ cdi_att_t *find_att(cdi_atts_t *attsp, const char *name)
if
(
attsp
->
nelems
==
0
)
return
NULL
;
size_t
slen
=
strlen
(
name
);
if
(
slen
>
CDI_MAX_NAME
)
slen
=
CDI_MAX_NAME
;
cdi_att_t
*
atts
=
attsp
->
value
;
for
(
size_t
attid
=
0
;
attid
<
attsp
->
nelems
;
attid
++
)
for
(
size_t
attid
=
0
;
attid
<
attsp
->
nelems
;
attid
++
)
{
cdi_att_t
*
attp
=
atts
+
attid
;
if
(
attp
->
namesz
==
slen
&&
memcmp
(
attp
->
name
,
name
,
slen
)
==
0
)
if
(
attp
->
namesz
==
slen
&&
memcmp
(
attp
->
name
,
name
,
slen
)
==
0
)
return
(
attp
);
/* Normal return */
}
...
...
@@ -69,6 +69,7 @@ cdi_att_t *new_att(cdi_atts_t *attsp, const char *name)
attsp
->
nelems
++
;
slen
=
strlen
(
name
);
if
(
slen
>
CDI_MAX_NAME
)
slen
=
CDI_MAX_NAME
;
attp
->
name
=
(
char
*
)
malloc
(
slen
+
1
);
memcpy
(
attp
->
name
,
name
,
slen
+
1
);
...
...
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