Skip to content
Permalink
Browse files Browse the repository at this point in the history
idn2_to_ascii_4i(): Restrict output length to 63
  • Loading branch information
rockdaboot committed Jan 9, 2019
1 parent 0965b23 commit e4d1558
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/lookup.c
Expand Up @@ -617,10 +617,18 @@ idn2_to_ascii_4i (const uint32_t * input, size_t inlen, char * output, int flags
* char * out output zero terminated string that must have room for at
* least 63 characters plus the terminating zero.
*/
size_t len = strlen ((char *) output_u8);

if (len > 63)
{
free (output_u8);
return IDN2_TOO_BIG_DOMAIN;
}

if (output)
strcpy (output, (const char *) output_u8);
strcpy (output, (char *) output_u8);

free(output_u8);
free (output_u8);
}

return rc;
Expand Down

0 comments on commit e4d1558

Please sign in to comment.