help-libidn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: testing Context O/J


From: Simon Josefsson
Subject: Re: testing Context O/J
Date: Wed, 20 Apr 2011 08:36:54 +0200
User-agent: Gnus/5.110016 (No Gnus v0.16) Emacs/23.2 (gnu/linux)

"Abdulrahman I. ALGhadir" <address@hidden> writes:

> Hey again,
> Sorry it took me awhile to do the test due the fact I was abit busy back then.
> When I was trying to compile the test-lookup.c with a set of examples of 
> existent domains I got this error msg:
> expected rc 0 got rc -206
>
> I have attached the file in case you want to see them.

Hi again.  I hadn't noticed you had added more domains, and though you
were problem with the shipped test vectors.  For reference, the first
domain that you added that trigger the problem is this one:

  
{"\xd8\xa5\xd8\xaf\xd8\xa7\xd8\xb1\xd8\xa9\xd8\xa7\xd9\x84\xd8\xaa\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9\xd9\x88\xd8\xa7\xd9\x84\xd8\xaa\xd8\xb9\xd9\x84\xd9\x8a\xd9\x85\x2d\xd9\x84\xd9\x84\xd8\xa8\xd9\x86\xd8\xa7\xd8\xaa\x2d\xd8\xa8\xd9\x85\xd8\xad\xd8\xa7\xd9\x81\xd8\xb8\xd8\xa9\xd8\xa7\xd9\x84\xd8\xb9\xd9\x84\xd8\xa7",
 "xn-----4sdiaabbaaeccgchhdd6d1a9bd4pqal6sqcfcbalbsi6a9d2dh"},

The error is:

  2  IDN2_TOO_BIG_LABEL                                                 
إدارةالتربيةوالتعليم-للبنات-بمحافظةالعلا
expected rc 0 got rc -206

Looking at the code it the TOO_BIG_LABEL check is clearly at the wrong
place:

static int
label (const uint8_t * src, size_t srclen, uint8_t * dst, size_t * dstlen,      
/* assumed to be 63 */
       int flags)
{
...
  if (srclen > 63)
    return IDN2_TOO_BIG_LABEL;

In other words, it is comparing the UTF-8 data against 63 and not the
ACE encoded output.

I have had some discussion about the label/domainname length checks
before, and had some suspicion that there are bugs in that code.  I'll
rework this and make sure it is correct.

Thank you for reporting this!

/Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]