Skip to content

Commit

Permalink
Merge pull request #450 from rouault/fix_nc4_check_name_buffer_overflow
Browse files Browse the repository at this point in the history
Fix stack buffer overflow in nc4_check_name()
  • Loading branch information
WardF committed Aug 8, 2017
2 parents 99625c0 + f6ac978 commit a6e3f57
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libsrc4/nc4internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit a6e3f57

Please sign in to comment.