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 go dereferencing pointers before verifying the...



details:   https://anonhg.NetBSD.org/src/rev/be396e779a7a
branches:  trunk
changeset: 472413:be396e779a7a
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Apr 29 11:28:42 1999 +0000

description:
Don't go dereferencing pointers before verifying they are aligned.

diffstat:

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

diffs (21 lines):

diff -r ac3b4cf45d2c -r be396e779a7a sys/ddb/db_aout.c
--- a/sys/ddb/db_aout.c Thu Apr 29 05:54:13 1999 +0000
+++ b/sys/ddb/db_aout.c Thu Apr 29 11:28:42 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_aout.c,v 1.23 1999/04/12 20:38:20 pk Exp $  */
+/*     $NetBSD: db_aout.c,v 1.24 1999/04/29 11:28:42 christos Exp $    */
 
 /* 
  * Mach Operating System
@@ -107,6 +107,11 @@
        sym_end   = (struct nlist *)((char *)sym_start + symsize);
 
        strtab = (char *)sym_end;
+       if (ALIGNED_POINTER(strtab, int) == 0) {
+               printf("[ %s symbol table has bad string table address %p ]\n",
+                   name, strtab);
+               return (FALSE);
+       }
        slen = *(int *)strtab;
 
        estrtab = strtab + slen;



Home | Main Index | Thread Index | Old Index