patch-2.2.19 linux/drivers/s390/char/hwc_tty.c

Next file: linux/drivers/s390/idals.c
Previous file: linux/drivers/s390/char/hwc_rw.h
Back to the patch index
Back to the overall index

diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.18/drivers/s390/char/hwc_tty.c linux/drivers/s390/char/hwc_tty.c
@@ -171,7 +171,9 @@
 
 	switch (cmd) {
 	case TIOCHWCTTYSINTRC:
-		count = strlen_user ((const char *) arg);
+		count = strnlen_user((const char *)arg, HWC_TTY_MAX_CNTL_SIZE);
+		if (!count)
+			return -EFAULT;
 		if (count > HWC_TTY_MAX_CNTL_SIZE)
 			return -EINVAL;
 		strncpy_from_user (hwc_tty_data.ioctl.intr_char,

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)