]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: lustre: add missing buffer overflow fix for console.c
authorDmitry Eremin <dmitry.eremin@intel.com>
Sat, 12 Mar 2016 18:00:32 +0000 (13:00 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2016 14:30:36 +0000 (07:30 -0700)
Patch 9389 change a strncpy call into a strlcpy call. This was
missed in the merger into the upstream client.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4629
Reviewed-on: http://review.whamcloud.com/9389
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lnet/selftest/console.c

index 1a923ea3a7553456930efc9805d27154f3968b74..c009ad348a067c45c014f9b3b3326233214223a1 100644 (file)
@@ -1749,7 +1749,7 @@ lstcon_session_new(char *name, int key, unsigned feats,
 
        if (strlen(name) > sizeof(console_session.ses_name) - 1)
                return -E2BIG;
-       strncpy(console_session.ses_name, name,
+       strlcpy(console_session.ses_name, name,
                sizeof(console_session.ses_name));
 
        rc = lstcon_batch_add(LST_DEFAULT_BATCH);