Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20131105191840.GD24286@brightrain.aerifal.cx>
Date: Tue, 5 Nov 2013 14:18:40 -0500
From: Rich Felker <dalias@...ifal.cx>
To: musl@...ts.openwall.com
Subject: Re: [PATCH] Fix dn_expand pointer following

On Mon, Nov 04, 2013 at 09:43:57PM -0800, Michael Forney wrote:
> ---
> While looking over the dn_{comp,expand} functions, I noticed that this looked
> wrong in dn_expand.
> 
> http://www.ietf.org/rfc/rfc1035.txt says that if the first two bits are 1s
> (i.e., *p & 0xc0), then the remaining 14 bits specify the offset.

Indeed. The code was just written for internal use in musl, which only
performs UDP queries, limiting the packet size to 512 bytes. Thus only
9 bits can be set in a valid packet. However it probably makes sense
to read the whole value anyway in case the caller of dn_expand was
using tcp or just to better reject invalid packets.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.