* symfile.c (add_symbol_file_command): Fix off-by-one when
authorAndreas Schwab <schwab@linux-m68k.org>
Thu, 24 Aug 2006 12:43:10 +0000 (12:43 +0000)
committerAndreas Schwab <schwab@linux-m68k.org>
Thu, 24 Aug 2006 12:43:10 +0000 (12:43 +0000)
extending sect_opts.

gdb/ChangeLog
gdb/symfile.c

index 3a115e24b3b0759d7ff1031eba4f4f6789bda60f..88d52a7109b9ee7a5e1bde0d9011216a4a5df3f2 100644 (file)
@@ -1,3 +1,8 @@
+2006-08-24  Andreas Schwab  <schwab@suse.de>
+
+       * symfile.c (add_symbol_file_command): Fix off-by-one when
+       extending sect_opts.
+
 2006-08-24  Nick Roberts  <nickrob@snap.net.nz>
 
        * mi/gdb-mi.el: Refer to next release of Emacs as 22.1.
index 8a6c65b94cbb15cba6d5962105eecd998376efe9..2036a073c141a58f0b11abce4e8ad210783eba52 100644 (file)
@@ -1853,7 +1853,7 @@ add_symbol_file_command (char *args, int from_tty)
                to load the program. */
            sect_opts[section_index].name = ".text";
            sect_opts[section_index].value = arg;
-           if (++section_index > num_sect_opts)
+           if (++section_index >= num_sect_opts)
              {
                num_sect_opts *= 2;
                sect_opts = ((struct sect_opt *)
@@ -1889,7 +1889,7 @@ add_symbol_file_command (char *args, int from_tty)
                    {
                      sect_opts[section_index].value = arg;
                      expecting_sec_addr = 0;
-                     if (++section_index > num_sect_opts)
+                     if (++section_index >= num_sect_opts)
                        {
                          num_sect_opts *= 2;
                          sect_opts = ((struct sect_opt *)