applied patch from zesstra which fixed ldmud bug #498

This commit is contained in:
Philipp Hancke 2009-03-12 06:38:07 +01:00
parent 2ede0de60e
commit 1d490d6a92
1 changed files with 5 additions and 4 deletions

View File

@ -137,6 +137,7 @@ f_idna_stringprep (svalue_t *sp)
/* Get and check the flags. */
{
p_uint argflags = (p_uint)sp->u.number;
sp--;
if (argflags > (STRINGPREP_FLAG_MAX << 1)-1
|| argflags & (STRINGPREP_NO_NFKC_FLAG | STRINGPREP_NO_BIDI_FLAG)
@ -151,12 +152,11 @@ f_idna_stringprep (svalue_t *sp)
if (argflags & STRINGPREP_NO_NFKC_FLAG) flags |= STRINGPREP_NO_NFKC;
if (argflags & STRINGPREP_NO_BIDI_FLAG) flags |= STRINGPREP_NO_BIDI;
if (argflags & STRINGPREP_NO_UNASSIGNED_FLAG) flags |= STRINGPREP_NO_UNASSIGNED;
free_svalue(sp--);
}
/* Get and check the profile */
prof = (int)sp->u.number;
free_svalue(sp--);
sp--;
/* select the profile */
switch(prof)
@ -214,12 +214,13 @@ f_idna_stringprep (svalue_t *sp)
if (ret != STRINGPREP_OK)
{
put_number(sp, -ret);
errorf("stringprep(): Error %s", stringprep_strerror(ret));
/* NOTREACHED */
}
}
else
{
// free the string argument
free_svalue(sp);
put_c_string(sp, buf);
}