mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: [PATCH] Fix dn_expand pointer following
Date: Tue, 5 Nov 2013 14:18:40 -0500	[thread overview]
Message-ID: <20131105191840.GD24286@brightrain.aerifal.cx> (raw)
In-Reply-To: <1383630237-2700-1-git-send-email-mforney@mforney.org>

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


      reply	other threads:[~2013-11-05 19:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-05  5:43 Michael Forney
2013-11-05 19:18 ` Rich Felker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131105191840.GD24286@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).