All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Borzenkov <arvidjaar@mail.ru>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] fix buffer overflow in udev_util_replace_whitespace()
Date: Sat, 05 Sep 2009 03:19:52 +0000	[thread overview]
Message-ID: <200909050719.55784.arvidjaar@mail.ru> (raw)
In-Reply-To: <20090831173335.GL4363@florz.florz.dyndns.org>

[-- Attachment #1: Type: Text/Plain, Size: 599 bytes --]

On Friday 04 of September 2009 23:34:45 Florian Zumbiehl wrote:
> Hi,
> 
> untested, ...
> 
> Florian
> 
> diff --git a/libudev/libudev-util.c b/libudev/libudev-util.c
> index 9a141db..a2aef84 100644
> --- a/libudev/libudev-util.c
> +++ b/libudev/libudev-util.c
> @@ -355,7 +355,7 @@ int udev_util_replace_whitespace(const char *str,
>  char *to, size_t len) size_t i, j;
> 
>  	/* strip trailing whitespace */
> -	len = strnlen(str, len);
> +	len = strnlen(str, len-1);
>  	while (len && isspace(str[len-1]))
>  		len--;
> 
wrong. Please try to understand what this loop does.

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  parent reply	other threads:[~2009-09-05  3:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-31 17:33 [PATCH] fix buffer overflow in udev_util_encode_string() Florian Zumbiehl
2009-09-01 10:56 ` Kay Sievers
2009-09-02 20:55 ` Karel Zak
2009-09-04 19:34 ` [PATCH] fix buffer overflow in udev_util_replace_whitespace() Florian Zumbiehl
2009-09-05  3:19 ` Andrey Borzenkov [this message]
2009-09-05  4:21 ` Florian Zumbiehl
2009-09-05 10:44 ` Alan Jenkins
2009-09-05 17:01 ` Florian Zumbiehl
2009-09-05 18:17 ` Alan Jenkins
2009-09-05 18:51 ` Andrey Borzenkov
2009-09-05 20:21 ` Florian Zumbiehl
2009-09-05 20:57 ` Florian Zumbiehl

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=200909050719.55784.arvidjaar@mail.ru \
    --to=arvidjaar@mail.ru \
    --cc=linux-hotplug@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.