mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
Merge pull request #450 from rouault/fix_nc4_check_name_buffer_overflow
Fix stack buffer overflow in nc4_check_name()
This commit is contained in:
commit
a6e3f577f2
@ -102,6 +102,11 @@ 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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user