lkml.org 
[lkml]   [2009]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    SubjectRe: [PATCH] [ARM] cumana: Fix a long standing bogon
    From: Alan Cox <alan@lxorguk.ukuu.org.uk>

    Should be using strncmp as the data from user space may be unterminated

    (Bug #8004)

    Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
    ---
    drivers/scsi/arm/cumana_2.c | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/drivers/scsi/arm/cumana_2.c b/drivers/scsi/arm/cumana_2.c
    index 68a6412..ed502b7 100644
    --- a/drivers/scsi/arm/cumana_2.c
    +++ b/drivers/scsi/arm/cumana_2.c
    @@ -318,7 +318,7 @@ cumanascsi_2_set_proc_info(struct Scsi_Host *host, char *buffer, int length)
    {
    int ret = length;

    - if (length >= 11 && strcmp(buffer, "CUMANASCSI2") == 0) {
    + if (length >= 11 && strncmp(buffer, "CUMANASCSI2", 11) == 0) {
    buffer += 11;
    length -= 11;


    \
     
     \ /
      Last update: 2009-03-29 10:55    [W:0.028 / U:2.224 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site