Applied fix for a stack buffer overflow into 4.5.0 release branch.

This commit is contained in:
Ward Fisher 2017-08-08 13:18:53 -06:00
parent ac503dd565
commit 24ca95645c

View File

@ -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;
}