diff options
author | Petr Machata <pmachata@redhat.com> | 2014-07-25 12:40:52 +0200 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-08-22 20:38:26 +0900 |
commit | dceb6df2657c94e6b422850f43c6c6d12554db11 (patch) | |
tree | 2cc0a1dda1b592e3e79bf3aa5c425b5cfc29da4d /library.c | |
parent | baa0a5cfd341752d95634f0c4118895bcd8cfe09 (diff) | |
download | ltrace-dceb6df2657c94e6b422850f43c6c6d12554db11.tar.gz ltrace-dceb6df2657c94e6b422850f43c6c6d12554db11.tar.bz2 ltrace-dceb6df2657c94e6b422850f43c6c6d12554db11.zip |
Fix cloning of libraries with Dwarf support
- struct library::dwfl_module was left unitialized after
library_clone. Garbage was kept in, which prevented proper
initialization later, and resulted in segmentation violation.
Diffstat (limited to 'library.c')
-rw-r--r-- | library.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1,6 +1,6 @@ /* * This file is part of ltrace. - * Copyright (C) 2011,2012,2013 Petr Machata, Red Hat Inc. + * Copyright (C) 2011,2012,2013,2014 Petr Machata, Red Hat Inc. * Copyright (C) 2001,2009 Juan Cespedes * Copyright (C) 2006 Ian Wienand * @@ -20,6 +20,8 @@ * 02110-1301 USA */ +#include "config.h" + #include <stdlib.h> #include <string.h> #include <assert.h> @@ -559,6 +561,12 @@ library_clone(struct library *retp, struct library *lib) goto fail; } +#if defined(HAVE_LIBDW) + /* Wipe DWFL_MODULE, leave it to proc_add_library to + * initialize. */ + lib->dwfl_module = NULL; +#endif + return 0; } |