Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/linux/common avoid array bounds violation on netb...



details:   https://anonhg.NetBSD.org/src/rev/409ae7362245
branches:  trunk
changeset: 766940:409ae7362245
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Jul 04 12:39:36 2011 +0000

description:
avoid array bounds violation on netbsd/mips when dealing with termio
structures.  (did linux/mips ever support termio?).

the effect of this is that termio linux apps won't have VEOF support.
i can't tell what it should be since that code isn't in linux going
back quite some years.

diffstat:

 sys/compat/linux/common/linux_termios.h |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (29 lines):

diff -r f7555cf381b6 -r 409ae7362245 sys/compat/linux/common/linux_termios.h
--- a/sys/compat/linux/common/linux_termios.h   Mon Jul 04 12:38:29 2011 +0000
+++ b/sys/compat/linux/common/linux_termios.h   Mon Jul 04 12:39:36 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_termios.h,v 1.19 2009/03/15 15:55:51 cegger Exp $        */
+/*     $NetBSD: linux_termios.h,v 1.20 2011/07/04 12:39:36 mrg Exp $   */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -263,7 +263,9 @@
        bts->c_cc[VQUIT] = lt->c_cc[LINUX_OLD_VQUIT];
        bts->c_cc[VERASE] = lt->c_cc[LINUX_OLD_VERASE];
        bts->c_cc[VKILL] = lt->c_cc[LINUX_OLD_VKILL];
+#if LINUX_VEOF < LINUX_NCC
        bts->c_cc[VEOF] = lt->c_cc[LINUX_OLD_VEOF];
+#endif
        bts->c_cc[VTIME] = lt->c_cc[LINUX_OLD_VTIME];
        bts->c_cc[VMIN] = lt->c_cc[LINUX_OLD_VMIN];
 }
@@ -347,7 +349,9 @@
        lt->c_cc[LINUX_VQUIT] = bts->c_cc[VQUIT];
        lt->c_cc[LINUX_VERASE] = bts->c_cc[VERASE];
        lt->c_cc[LINUX_VKILL] = bts->c_cc[VKILL];
+#if LINUX_VEOF < LINUX_NCC
        lt->c_cc[LINUX_VEOF] = bts->c_cc[VEOF];
+#endif
        lt->c_cc[LINUX_VTIME] = bts->c_cc[VTIME];
        lt->c_cc[LINUX_VMIN] = bts->c_cc[VMIN];
        lt->c_cc[LINUX_VSWTC] = 0;



Home | Main Index | Thread Index | Old Index