Source-Changes-HG archive

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

[src/trunk]: src/sys/ddb Don't load the symbol table if it's corrupted.



details:   https://anonhg.NetBSD.org/src/rev/4bc4c29bba42
branches:  trunk
changeset: 473681:4bc4c29bba42
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Jun 15 00:23:19 1999 +0000

description:
Don't load the symbol table if it's corrupted.

diffstat:

 sys/ddb/db_aout.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r 9156ff5b0c59 -r 4bc4c29bba42 sys/ddb/db_aout.c
--- a/sys/ddb/db_aout.c Mon Jun 14 23:55:29 1999 +0000
+++ b/sys/ddb/db_aout.c Tue Jun 15 00:23:19 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_aout.c,v 1.25 1999/06/05 08:36:29 pk Exp $  */
+/*     $NetBSD: db_aout.c,v 1.26 1999/06/15 00:23:19 thorpej Exp $     */
 
 /* 
  * Mach Operating System
@@ -90,7 +90,7 @@
        register struct nlist   *sym_start, *sym_end;
        register struct nlist   *sp;
        register char *strtab;
-       register int slen;
+       register int slen, bad = 0;
        char *estrtab;
 
        if (ALIGNED_POINTER(vsymtab, long) == 0) {
@@ -133,12 +133,16 @@
                    printf("[ %s has bad a.out string table index (0x%x) ]\n",
                        name, strx);
                    sp->n_un.n_name = 0;
+                   bad = 1;
                    continue;
                }
                sp->n_un.n_name = strtab + strx;
            }
        }
 
+       if (bad)
+               return (FALSE);
+
        if (db_add_symbol_table((char *)sym_start, (char *)sym_end, name,
            NULL) !=  -1) {
                 printf("[ preserving %ld bytes of %s a.out symbol table ]\n",



Home | Main Index | Thread Index | Old Index