From 6dcc1893b6542ed5605fa1079a817adecb73daa0 Mon Sep 17 00:00:00 2001 From: Paul Pluzhnikov Date: Tue, 21 May 2013 23:41:29 +0000 Subject: [PATCH] 2013-05-21 Paul Pluzhnikov * solib-svr4.c (svr4_free_so): Protect against NULL dereference. --- gdb/ChangeLog | 4 ++++ gdb/solib-svr4.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 24e5eb4f922..1d325d0e25e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2013-05-21 Paul Pluzhnikov + + * solib-svr4.c (svr4_free_so): Protect against NULL dereference. + 2013-05-21 Pedro Alves * python/py-prettyprint.c (apply_val_pretty_printer): Check diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 4e094728e89..055fcb73ead 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -971,7 +971,8 @@ svr4_free_so (struct so_list *so) static void svr4_clear_so (struct so_list *so) { - so->lm_info->l_addr_p = 0; + if (so->lm_info != NULL) + so->lm_info->l_addr_p = 0; } /* Free so_list built so far (called via cleanup). */ -- 2.30.2