lkml.org 
[lkml]   [2013]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [Suggestion] drivers/staging/tidspbridge: strcpy and strncpy, src length checking issue.
From
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.

Cheers,

Omar


\
 
 \ /
  Last update: 2013-01-05 13:01    [W:0.133 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site