kernel_optimize_test/scripts/kconfig
Cheng Renquan cd58a90fa6 scripts/kconfig/nconf: fix memmove's length arg
In case KEY_BACKSPACE / KEY_DC to delete a char, it memmove only
(len-cursor_position+1) bytes;
the default case is to insert a char, it should also memmove exactly
(len-cursor_position+1) bytes;

the original use of (len+1) is wrong and may access following memory
that doesn't belong to result, may cause SegFault in theory;

	case KEY_BACKSPACE:
		if (cursor_position > 0) {
			memmove(&result[cursor_position-1],
					&result[cursor_position],
					len-cursor_position+1);
			cursor_position--;
		}
		break;
	case KEY_DC:
		if (cursor_position >= 0 && cursor_position < len) {
			memmove(&result[cursor_position],
					&result[cursor_position+1],
					len-cursor_position+1);
		}
		break;
	default:
		if ((isgraph(res) || isspace(res)) &&
				len-2 < result_len) {
			/* insert the char at the proper position */
			memmove(&result[cursor_position+1],
					&result[cursor_position],
					len-cursor_position+1);
			result[cursor_position] = res;
			cursor_position++;
		}

Signed-off-by: Cheng Renquan <crquan@gmail.com>
Acked-by: Nir Tzachar <nir.tzachar@gmail.com>
2011-09-09 14:40:08 +02:00
..
lxdialog kconfig: fix set but not used variables 2011-08-29 20:22:26 -04:00
.gitignore kconfig: migrate parser to implicit rules 2011-06-09 14:04:44 -04:00
check.sh kbuild: check if we can link gettext not just compile 2007-10-12 21:13:50 +02:00
conf.c kconfig/conf: mark xfgets() private 2011-07-02 01:04:40 -04:00
confdata.c kconfig: fix __enabled_ macros definition for invisible and un-selected symbols 2011-08-29 20:19:48 -04:00
expr.c kconfig: use calloc() for expr allocation 2011-07-02 01:04:37 -04:00
expr.h kconfig: nuke reference to SWIG 2011-06-06 15:32:18 -04:00
gconf.c kconfig/gconf: kill deadcode 2011-06-06 15:32:22 -04:00
gconf.glade scripts/kconfig/gconf.glade Update broken web addresses. 2010-09-17 16:54:42 +02:00
images.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
kxgettext.c kconfig: nuke LKC_DIRECT_LINK cruft 2011-06-06 15:32:20 -04:00
lkc_proto.h kconfig: introduce specialized printer 2011-07-01 16:23:27 +02:00
lkc.h Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2011-07-30 00:17:06 -07:00
Makefile kconfig/streamline_config.pl: merge local{mod,yes}config 2011-08-08 01:44:27 -04:00
mconf.c kconfig: handle SIGINT in menuconfig 2011-08-29 20:21:29 -04:00
menu.c kconfig: factor code in menu_get_ext_help() 2011-08-08 16:02:03 +02:00
nconf.c kconfig/nconf: nuke unreferenced `nohelp_text' 2011-08-08 15:26:51 +02:00
nconf.gui.c scripts/kconfig/nconf: fix memmove's length arg 2011-09-09 14:40:08 +02:00
nconf.h nconfig: add search support 2010-08-16 22:04:55 +02:00
POTFILES.in kconfig: gettext support for lxdialog 2008-01-28 23:14:39 +01:00
qconf.cc xconfig: Abort close if configuration cannot be saved 2011-07-25 15:50:34 +02:00
qconf.h xconfig: Abort close if configuration cannot be saved 2011-07-25 15:50:34 +02:00
streamline_config.pl kconfig/streamline_config.pl: use options to determine operating mode 2011-08-08 01:44:26 -04:00
symbol.c kconfig: introduce specialized printer 2011-07-01 16:23:27 +02:00
util.c kconfig: add missing <stdlib.h> inclusion 2011-06-06 15:32:16 -04:00
zconf.gperf kconfig: constify `kconf_id_lookup' 2011-06-09 14:04:42 -04:00
zconf.hash.c_shipped kconfig: regen parser 2011-06-09 14:04:45 -04:00
zconf.l Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2011-07-30 00:17:06 -07:00
zconf.lex.c_shipped Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2011-07-30 00:17:06 -07:00
zconf.tab.c_shipped Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2011-07-30 00:17:06 -07:00
zconf.y Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 2011-07-30 00:17:06 -07:00