summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kmod/igb/igb_main.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/kmod/igb/igb_main.c b/kmod/igb/igb_main.c
index 0ed5b161..13fdd6d0 100644
--- a/kmod/igb/igb_main.c
+++ b/kmod/igb/igb_main.c
@@ -10219,12 +10219,11 @@ static int igb_bind(struct file *file, void __user *argp)
if (copy_from_user(&req, argp, sizeof(req)))
return -EFAULT;
- /*setting the last character of req.iface to '/0'
- in order to avoid not null terminated string printk call.
- Regardless of the initial state of string, that change
- will prevent from stack leaking.
- In this case no need to check the string or iterate over it
- in order to ensure null termination exists*/
+ /*
+ * Set the last character of req.iface to '/0' to
+ * guarantee null termination of req.iface string
+ * param in printk call.
+ */
req.iface[IGB_BIND_NAMESZ-1] = 0;
printk("bind to iface %s\n", req.iface);