[bind10-dev] arbitrary character and plain char
JINMEI Tatuya / 神明達哉
jinmei at isc.org
Wed May 9 19:48:04 UTC 2012
At Wed, 9 May 2012 09:33:45 +0200,
Michal 'vorner' Vaner <michal.vaner at nic.cz> wrote:
> > Now I don't understand why you don't think it will work...could you be
> > more specific about how exactly it will fail?
>
> Are we talking about char in the lexer or char in the Name object?
I thought char in the lexer.
> If the lexer, then the problem really is high-bits in the input text. If the
> later, we just copy the data into the memory area occupied by the Name buffer
> and don't interpret them. However, in case we have \255, we need to convert it
> and then we would be doing effectively this:
>
> char c = atoi("255");
>
> and then put the c into the Name object. This is where it may break.
Ah, okay, understood. You're right about that (and it won't be
specific to the loader from text; the same problem exists for
constructing the objects from wire). As for Name objects, I think
#1774 will partly solve the issue.
But, in general, we use char-based parameters in many other places,
and there will be other similar issues. Building TXT RDATA will have
the same issue, and there will be even more unusual corner cases
(e.g. "AAA\255" for an RR type could be interpreted as "AAAA").
How perfect we'd like to be about these cases is another question, and
I'm not really sure about it yet.
---
JINMEI, Tatuya
Internet Systems Consortium, Inc.
More information about the bind10-dev
mailing list