[rtems commit] PR 2001/shell - medit command argument parsing correction

Joel Sherrill joel at rtems.org
Fri Feb 3 22:06:36 UTC 2012


Module:    rtems
Branch:    4.10
Commit:    7f0ad21d1552479dfdf6b6dddae9bb3c513f04b1
Changeset: http://git.rtems.org/rtems/commit/?id=7f0ad21d1552479dfdf6b6dddae9bb3c513f04b1

Author:    Joel Sherrill <joel.sherrill at oarcorp.com>
Date:      Fri Feb  3 16:04:13 2012 -0600

PR 2001/shell - medit command argument parsing correction

"medit" overran the argument list, choking on the NULL pointer
following the last argument.

Note that "medit" still only does byte-sized accesses, which limits
its usefulness on most systems.

Author: Werner Almesberger <werner at almesberger.net>
Signed-off-by: Sebastien Bourdeauducq <sebastien at milkymist.org>

---

 cpukit/libmisc/shell/main_medit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cpukit/libmisc/shell/main_medit.c b/cpukit/libmisc/shell/main_medit.c
index 7905fbe..aed3153 100644
--- a/cpukit/libmisc/shell/main_medit.c
+++ b/cpukit/libmisc/shell/main_medit.c
@@ -55,7 +55,7 @@ int rtems_shell_main_medit(
    * Now edit the memory
    */
   n = 0;
-  for (i=2 ; i<=argc ; i++) {
+  for (i=2 ; i<argc ; i++) {
     unsigned char tmpc;
 
     if ( rtems_string_to_unsigned_char(argv[i], &tmpc, NULL, 0) ) {




More information about the vc mailing list