From 1224e8fc1da9cddef6bdb24814300893bb2ace89 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 27 Apr 2010 10:21:12 -0700 Subject: [PATCH] datapath: Fix argument to strncpy_from_user(). The strncpy_from_user() function's 'count' argument is documented to include the trailing null byte, but create_dp() did not include it. This commit adds it in. --- datapath/datapath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index e1320f24d..be16044d5 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -203,7 +203,7 @@ static int create_dp(int dp_idx, const char __user *devnamep) if (devnamep) { err = -EFAULT; - if (strncpy_from_user(devname, devnamep, IFNAMSIZ - 1) < 0) + if (strncpy_from_user(devname, devnamep, IFNAMSIZ) < 0) goto err; devname[IFNAMSIZ - 1] = '\0'; } else { -- 2.43.0