LKML Archive on
help / color / mirror / Atom feed
From: WANG Cong <>
Subject: Re: [PATCH] Do not potentially overflow string in sumversion
Date: Fri, 21 Jan 2011 06:18:35 +0000 (UTC)	[thread overview]
Message-ID: <ihb8fr$jbj$> (raw)
In-Reply-To: <>

On Fri, 21 Jan 2011 00:00:56 +0100, Jesper Juhl wrote:

> In scripts/mod/sumversion.c (in get_src_version()) we call
> getenv("MODVERDIR"). This returns a pointer to a string of unknown
> length. This string of unknown length we then pass on as an argument to
> sprintf() and tell it to write the result to 'filelist' which has a,
> very much fixed, size of 'PATH_MAX + 1'. If the string returned by
> getenv() is too long we'll overrun the statically allocated buffer. This
> patch prevents the buffer overrun by using snprintf() and telling it to
> copy a maximum of 'PATH_MAX + 1' bytes (including the terminating \0).
> Signed-off-by: Jesper Juhl <> ---

Acked-by: WANG Cong <>

Next time, please Cc linux-kbuild for kbuild changes.


      reply	other threads:[~2011-01-21  6:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-20 23:00 Jesper Juhl
2011-01-21  6:18 ` WANG Cong [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:

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

  git send-email \
    --in-reply-to='ihb8fr$jbj$' \ \ \
    --subject='Re: [PATCH] Do not potentially overflow string in sumversion' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).