public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Colin King <colin.king@canonical.com>
Cc: William Hubbs <w.d.hubbs@gmail.com>,
	Chris Brannon <chris@the-brannons.com>,
	Kirk Reiser <kirk@reisers.ca>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Amitoj Kaur Chawla <amitoj1606@gmail.com>,
	speakup@linux-speakup.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: speakup: ensure we do not overrun synths array
Date: Tue, 10 May 2016 00:44:02 +0200	[thread overview]
Message-ID: <20160509224402.GV3473@var.home> (raw)
In-Reply-To: <1462832534-11128-1-git-send-email-colin.king@canonical.com>

Colin King, on Mon 09 May 2016 23:22:14 +0100, wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> synth_add allows one to add MAXSYNTHS synths to the synths array;
> however it always NULLifies the next synth in the array which
> means that on the MAXSYNTHS synth we get an out-of-bounds write of
> the NULL to the synths array.  Make the synths array MAXSYNTHS + 1
> elements in size to allow for the final NULL sentinal to avoid the
> out-of-bounds write.
> 
> Issue found wit CoverityScan, CID#744671
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  drivers/staging/speakup/synth.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c
> index 4f462c3..810a214 100644
> --- a/drivers/staging/speakup/synth.c
> +++ b/drivers/staging/speakup/synth.c
> @@ -18,7 +18,7 @@
>  #include "serialio.h"
>  
>  #define MAXSYNTHS       16      /* Max number of synths in array. */
> -static struct spk_synth *synths[MAXSYNTHS];
> +static struct spk_synth *synths[MAXSYNTHS + 1];
>  struct spk_synth *synth;
>  char spk_pitch_buff[32] = "";
>  static int module_status;
> -- 
> 2.8.1
> 

-- 
Samuel
Actually, typing random strings in the Finder does the equivalent of
filename completion.
(Discussion in comp.os.linux.misc on the intuitiveness of commands: file
completion vs. the Mac Finder.)

      reply	other threads:[~2016-05-09 22:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-09 22:22 [PATCH] staging: speakup: ensure we do not overrun synths array Colin King
2016-05-09 22:44 ` Samuel Thibault [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=20160509224402.GV3473@var.home \
    --to=samuel.thibault@ens-lyon.org \
    --cc=amitoj1606@gmail.com \
    --cc=chris@the-brannons.com \
    --cc=colin.king@canonical.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kirk@reisers.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=speakup@linux-speakup.org \
    --cc=w.d.hubbs@gmail.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox