All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen Gang <gang.chen@asianux.com>
To: Omar Ramirez Luna <omar.ramirez@copitl.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Suggestion] drivers/staging/tidspbridge: strcpy and strncpy, src length checking issue.
Date: Sat, 05 Jan 2013 19:24:26 +0800	[thread overview]
Message-ID: <50E80D6A.2050702@asianux.com> (raw)
In-Reply-To: <CAJ6Av5MP8gjck=WqjLJMLEtHbbaMOT2aFxExP4YkGScE-O0L8A@mail.gmail.com>

于 2013年01月05日 19:17, Omar Ramirez Luna 写道:
> Hi,
> 
> On Thu, Dec 13, 2012 at 9:50 PM, Chen Gang <gang.chen@asianux.com> wrote:
>>   in drivers/staging/tidspbridge/rmgr/proc.c:
>>
>>     if strlen(drv_datap->base_img) == size, will pass checking (line 397)
>>     the size is the full length of exec_file (line 382, line 468..469)
>>     strcpy causes issue: src len is strlen(drv_datap->base_img) + '\0'. (line 400)
> 
> Good catch.
> 
>>     strncpy seems also has issue: need use size instead of strlen(iva_img) + 1. (line 402..403)
> 
> This code is not used, it is best to remove it.
> 

  thank you.

  :-)

gchen


> Cheers,
> 
> Omar
> 
> 


-- 
Chen Gang

Asianux Corporation

      reply	other threads:[~2013-01-05 11:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-14  3:50 [Suggestion] drivers/staging/tidspbridge: strcpy and strncpy, src length checking issue Chen Gang
2012-12-18  2:40 ` Chen Gang
2012-12-18  5:03   ` Chen Gang
2012-12-24 14:27   ` Omar Ramirez Luna
2012-12-26  1:54     ` Chen Gang
2012-12-31  3:28 ` Chen Gang
2013-01-05 11:16   ` Omar Ramirez Luna
2013-01-05 11:17 ` Omar Ramirez Luna
2013-01-05 11:24   ` Chen Gang [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=50E80D6A.2050702@asianux.com \
    --to=gang.chen@asianux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=omar.ramirez@copitl.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 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.