lkml.org 
[lkml]   [2013]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.4 33/39] powerpc/vio: use strcpy in modalias_show
    Date
    3.4-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Prarit Bhargava <prarit@redhat.com>

    commit 411cabf79e684171669ad29a0628c400b4431e95 upstream.

    Commit e82b89a6f19bae73fb064d1b3dd91fcefbb478f4 used strcat instead of
    strcpy which can result in an overflow of newlines on the buffer.

    Signed-off-by: Prarit Bhargava
    Cc: benh@kernel.crashing.org
    Cc: ben@decadent.org.uk
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    arch/powerpc/kernel/vio.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    --- a/arch/powerpc/kernel/vio.c
    +++ b/arch/powerpc/kernel/vio.c
    @@ -1342,12 +1342,12 @@ static ssize_t modalias_show(struct devi

    dn = dev->of_node;
    if (!dn) {
    - strcat(buf, "\n");
    + strcpy(buf, "\n");
    return strlen(buf);
    }
    cp = of_get_property(dn, "compatible", NULL);
    if (!cp) {
    - strcat(buf, "\n");
    + strcpy(buf, "\n");
    return strlen(buf);
    }




    \
     
     \ /
      Last update: 2013-11-27 03:41    [W:2.644 / U:0.120 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site