From: Ben Pfaff Date: Tue, 27 Apr 2010 17:21:12 +0000 (-0700) Subject: datapath: Fix argument to strncpy_from_user(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1224e8fc1da9cddef6bdb24814300893bb2ace89;p=openvswitch 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. --- diff --git a/datapath/datapath.c b/datapath/datapath.c index e1320f24..be16044d 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 {