Re: ares_parse_txt_reply's output is not usable for DNS-SD

2013-04-15 Thread Patrick Valsecchi
On 04/15/2013 10:32 PM, Daniel Stenberg wrote: On Mon, 15 Apr 2013, Patrick Valsecchi wrote: In attachment, you find a patch against the current git that includes yours and the fixes for the other problems. I tested against my feature tests on Linux, but I use only parsing of PTR, SRV and TXT.

mDNS (was Re: ares_parse_txt_reply's output is not usable for DNS-SD)

2013-04-15 Thread Daniel Stenberg
On Mon, 15 Apr 2013, Patrick Valsecchi wrote: While I'm writing to this mailing list, I've seen some discussions in the archives about doing an implementation for mDNS. What is the status on that? I'm not aware of anyone working on that! -- / daniel.haxx.se

Re: ares_parse_txt_reply's output is not usable for DNS-SD

2013-04-15 Thread Daniel Stenberg
On Mon, 15 Apr 2013, Patrick Valsecchi wrote: In attachment, you find a patch against the current git that includes yours and the fixes for the other problems. I tested against my feature tests on Linux, but I use only parsing of PTR, SRV and TXT. I pushed the commit 148c8e0353d93d7c0 now.

Re: ares_parse_txt_reply's output is not usable for DNS-SD

2013-04-15 Thread Daniel Stenberg
On Mon, 15 Apr 2013, Patrick Valsecchi wrote: 2) change ares_parse_txt_reply to return another ares_txt_reply node for each sub-string. IMHO, I think this is the right approach. Possibly it's bad changing behavior of that public function... But I wonder how many actually use the parse

Re: ares_parse_txt_reply's output is not usable for DNS-SD

2013-04-15 Thread Tommie Gannert
2013/4/15 Patrick Valsecchi > In attachment, you find a patch against the current git that includes > yours and the fixes for the other problems. I tested against my feature > tests on Linux, but I use only parsing of PTR, SRV and TXT. There are no > test included with the c-ares source code? >

Re: ares_parse_txt_reply's output is not usable for DNS-SD

2013-04-15 Thread Patrick Valsecchi
On 04/15/2013 11:22 AM, Tommie Gannert wrote: 2013/4/15 Patrick Valsecchi > Hi, I'm using c-ares for doing DNS-SD. For that, I need to interpret TXT records formatted as specified in the DNS-SD spec [1]. Unfortunately, the ares_parse_txt_reply function

Re: ares_parse_txt_reply's output is not usable for DNS-SD

2013-04-15 Thread Patrick Valsecchi
On 04/15/2013 02:00 PM, Tommie Gannert wrote: 2013/4/15 Patrick Valsecchi > - ares_parse_a_reply: I have a feeling that rr_name is leaked if the code reaches lines 157 or 168 - ares_parse__reply: same suspicions By a quick look at GitHub master, I

Re: ares_parse_txt_reply's output is not usable for DNS-SD

2013-04-15 Thread Tommie Gannert
2013/4/15 Patrick Valsecchi > - ares_parse_a_reply: I have a feeling that rr_name is leaked if the > code reaches lines 157 or 168 > - ares_parse__reply: same suspicions > By a quick look at GitHub master, I think the code looks good. The second if-statement seems to handle rr_name regar

Re: ares_parse_txt_reply's output is not usable for DNS-SD

2013-04-15 Thread Daniel Stenberg
On Mon, 15 Apr 2013, Patrick Valsecchi wrote: Who has the authority to accept patches? I do (and a couple of others as well). And of course getting additional +1s on patches make me accept them faster and easier... -- / daniel.haxx.se

Re: ares_parse_txt_reply's output is not usable for DNS-SD

2013-04-15 Thread Patrick Valsecchi
On 04/15/2013 12:51 PM, Tommie Gannert wrote: 2013/4/15 Tommie Gannert mailto:tom...@spotify.com>> 2013/4/15 Patrick Valsecchi mailto:pvals...@cisco.com>> The first sub-string is fine, but with the second sub-string, the code in ares_parse_txt.c (c-ares version 1.9.1) will h

Re: ares_parse_txt_reply's output is not usable for DNS-SD

2013-04-15 Thread Tommie Gannert
2013/4/15 Tommie Gannert > 2013/4/15 Patrick Valsecchi > >> The first sub-string is fine, but with the second sub-string, the code >> in ares_parse_txt.c (c-ares version 1.9.1) will have a bad behavior. The >> loop line 146 will just compute a total length of 4+255=259 and the loop >> line 164

Re: ares_parse_txt_reply's output is not usable for DNS-SD

2013-04-15 Thread Tommie Gannert
2013/4/15 Patrick Valsecchi > The first sub-string is fine, but with the second sub-string, the code > in ares_parse_txt.c (c-ares version 1.9.1) will have a bad behavior. The > loop line 146 will just compute a total length of 4+255=259 and the loop > line 164 can have two possible outcomes: cr

Re: ares_parse_txt_reply's output is not usable for DNS-SD

2013-04-15 Thread Patrick Valsecchi
While I'm in this part of the code, there is something that is frightening me. Imagine that you receive a DNS TXT reply with a packet that is crafted with a sub-string length that is bigger than the record length. Here is an example of such TXT RR: 0x04 "toto" 0xFF "crash?" The first sub-str

Re: ares_parse_txt_reply's output is not usable for DNS-SD

2013-04-15 Thread Tommie Gannert
2013/4/15 Patrick Valsecchi > Hi, > > I'm using c-ares for doing DNS-SD. For that, I need to interpret TXT > records formatted as specified in the DNS-SD spec [1]. Unfortunately, the > ares_parse_txt_reply function just concatenates the sub-strings of the TXT > record I get into a single string,

ares_parse_txt_reply's output is not usable for DNS-SD

2013-04-15 Thread Patrick Valsecchi
Hi, I'm using c-ares for doing DNS-SD. For that, I need to interpret TXT records formatted as specified in the DNS-SD spec [1]. Unfortunately, the ares_parse_txt_reply function just concatenates the sub-strings of the TXT record I get into a single string, loosing the information of the vario