Don't segfault the kernel if it can't resolve a name on a backtrace.
authorSimon Schubert <corecode@dragonflybsd.org>
Fri, 2 Feb 2007 15:57:51 +0000 (15:57 +0000)
committerSimon Schubert <corecode@dragonflybsd.org>
Fri, 2 Feb 2007 15:57:51 +0000 (15:57 +0000)
sys/platform/pc32/i386/db_trace.c
sys/platform/vkernel/i386/db_trace.c

index 3d01577..f1ed532 100644 (file)
@@ -24,7 +24,7 @@
  * rights to redistribute these changes.
  *
  * $FreeBSD: src/sys/i386/i386/db_trace.c,v 1.35.2.3 2002/02/21 22:31:25 silby Exp $
- * $DragonFly: src/sys/platform/pc32/i386/db_trace.c,v 1.17 2007/01/08 03:33:42 dillon Exp $
+ * $DragonFly: src/sys/platform/pc32/i386/db_trace.c,v 1.18 2007/02/02 15:57:51 corecode Exp $
  */
 
 #include <sys/param.h>
@@ -391,7 +391,8 @@ db_stack_trace_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count,
                                        actframe = (struct i386_frame *)
                                            (SP_REGS(&ddb_regs) - 4);
                                }
-                       } else if (!strcmp(name, "fork_trampoline")) {
+                       } else if (name != NULL &&
+                                  strcmp(name, "fork_trampoline") == 0) {
                                /*
                                 * Don't try to walk back on a stack for a
                                 * process that hasn't actually been run yet.
index d0438cb..0b0864b 100644 (file)
@@ -24,7 +24,7 @@
  * rights to redistribute these changes.
  *
  * $FreeBSD: src/sys/i386/i386/db_trace.c,v 1.35.2.3 2002/02/21 22:31:25 silby Exp $
- * $DragonFly: src/sys/platform/vkernel/i386/db_trace.c,v 1.5 2007/01/12 06:07:29 dillon Exp $
+ * $DragonFly: src/sys/platform/vkernel/i386/db_trace.c,v 1.6 2007/02/02 15:57:51 corecode Exp $
  */
 
 #include <sys/param.h>
@@ -357,7 +357,8 @@ db_stack_trace_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count,
                                        actframe = (struct i386_frame *)
                                            (SP_REGS(&ddb_regs) - 4);
                                }
-                       } else if (!strcmp(name, "fork_trampoline")) {
+                       } else if (name != NULL &&
+                                  strcmp(name, "fork_trampoline") == 0) {
                                /*
                                 * Don't try to walk back on a stack for a
                                 * process that hasn't actually been run yet.