Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/hppa/hppa Don't NULL deref on unknown subop, e.g. P...
details: https://anonhg.NetBSD.org/src/rev/a9b2a894feec
branches: trunk
changeset: 772778:a9b2a894feec
user: skrll <skrll%NetBSD.org@localhost>
date: Mon Jan 16 09:01:35 2012 +0000
description:
Don't NULL deref on unknown subop, e.g. PA2.0 instruction.
Print undefined instead of ???.
diffstat:
sys/arch/hppa/hppa/db_disasm.c | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
diffs (46 lines):
diff -r d49f0a8b6c8b -r a9b2a894feec sys/arch/hppa/hppa/db_disasm.c
--- a/sys/arch/hppa/hppa/db_disasm.c Sun Jan 15 22:34:33 2012 +0000
+++ b/sys/arch/hppa/hppa/db_disasm.c Mon Jan 16 09:01:35 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_disasm.c,v 1.12 2009/11/03 05:07:26 snj Exp $ */
+/* $NetBSD: db_disasm.c,v 1.13 2012/01/16 09:01:35 skrll Exp $ */
/* $OpenBSD: db_disasm.c,v 1.9 2000/04/18 20:02:45 mickey Exp $ */
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.12 2009/11/03 05:07:26 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.13 2012/01/16 09:01:35 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -2253,16 +2253,18 @@
else
i = m->subops[ext];
- if (i->dasmfcn != coprDasm && i->dasmfcn != diagDasm &&
- i->dasmfcn != ariDasm && i->dasmfcn != scDasm &&
- i->dasmfcn != ldDasm)
- db_printf(i->mnem);
- if (i->dasmfcn)
- (*i->dasmfcn)(i, ofs, instruct);
- else if (i->mnem[0] == '?')
- db_printf("???");
+ if (i) {
+ if (i->dasmfcn != coprDasm && i->dasmfcn != diagDasm &&
+ i->dasmfcn != ariDasm && i->dasmfcn != scDasm &&
+ i->dasmfcn != ldDasm)
+ db_printf("%s", i->mnem);
+ if (i->dasmfcn)
+ (*i->dasmfcn)(i, ofs, instruct);
+ } else {
+ db_printf("undefined subop");
+ }
} else
- db_printf("???");
+ db_printf("undefined");
db_printf("\n");
return (loc + sizeof(instruct));
Home |
Main Index |
Thread Index |
Old Index