android_kernel_samsung_univ.../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
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
gconf.c
gconf.glade
images.c
kxgettext.c
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
POTFILES.in
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
zconf.gperf
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