linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Jan-Marek Glogowski <glogow-iG8UcmBuX++ELgA04lAiVw@public.gmane.org>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] idmapd: Fix decoding of octal encoded fields.
Date: Wed, 21 Sep 2011 15:40:08 -0400	[thread overview]
Message-ID: <4E7A3D98.1010405@RedHat.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1109201952540.26882-icXI/ei3vljFQw+nKBmkQg@public.gmane.org>



On 09/20/2011 02:14 PM, Jan-Marek Glogowski wrote:
> The decoded octal will always be positive and (char) -1 is negative. Any field containing an encoded octal will be rejected.
> 
> As the encoded value should be an unsigned char, fix the check to reject all values > (unsigned char) -1 = UCHAR_MAX, as this indicate an error in the encoding.
> 
> Signed-off-by: Jan-Marek Glogowski <glogow-iG8UcmBuX++ELgA04lAiVw@public.gmane.org>
Committed..

steved.

> 
> --- nfs-utils-1.2.4.orig/utils/idmapd/idmapd.c
> +++ nfs-utils-1.2.4/utils/idmapd/idmapd.c
> @@ -925,9 +925,9 @@ getfield(char **bpp, char *fld, size_t f
>          if (*bp == '\\') {
>              if ((n = sscanf(bp, "\\%03o", &val)) != 1)
>                  return (-1);
> -            if (val > (char)-1)
> +            if (val > UCHAR_MAX)
>                  return (-1);
> -            *fld++ = (char)val;
> +            *fld++ = val;
>              bp += 4;
>          } else {
>              *fld++ = *bp;
> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2011-09-21 19:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-20 18:14 [PATCH] idmapd: Fix decoding of octal encoded fields Jan-Marek Glogowski
     [not found] ` <alpine.DEB.2.02.1109201952540.26882-icXI/ei3vljFQw+nKBmkQg@public.gmane.org>
2011-09-21 19:40   ` Steve Dickson [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=4E7A3D98.1010405@RedHat.com \
    --to=steved@redhat.com \
    --cc=glogow-iG8UcmBuX++ELgA04lAiVw@public.gmane.org \
    --cc=linux-nfs@vger.kernel.org \
    /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.
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).