mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-30 16:10:44 +08:00
Applied fix for a stack buffer overflow into 4.5.0 release branch.
This commit is contained in:
parent
ac503dd565
commit
24ca95645c
@ -102,6 +102,12 @@ nc4_check_name(const char *name, char *norm_name)
|
||||
retval = nc_utf8_normalize((const unsigned char *)name,(unsigned char**)&temp);
|
||||
if(retval != NC_NOERR)
|
||||
return retval;
|
||||
|
||||
if(strlen(temp) > NC_MAX_NAME) {
|
||||
free(temp);
|
||||
return NC_EMAXNAME;
|
||||
}
|
||||
|
||||
strcpy(norm_name, temp);
|
||||
free(temp);
|
||||
|
||||
@ -1603,4 +1609,3 @@ NC4_show_metadata(int ncid)
|
||||
#endif /*LOGGING*/
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user