From: Mark Murawki Date: Mon, 30 Apr 2012 15:51:12 +0000 (+0000) Subject: Sanatize result from bfd_find_nearest_line (BETTER_BACKTRACES) X-Git-Tag: 1.8.13.0-rc1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a6bdce6b4f38d971cd38d9373bf5e97f02c7843;p=thirdparty%2Fasterisk.git Sanatize result from bfd_find_nearest_line (BETTER_BACKTRACES) bfd_find_nearest_line can possibly set file to null resulting in a crash when strrchr(file) runs (closes issue ASTERISK-19815) Reported by Mark Murawski Tested by Mark Murawski git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@364635 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/logger.c b/main/logger.c index d01e96ee8d..d895b7af49 100644 --- a/main/logger.c +++ b/main/logger.c @@ -1383,6 +1383,9 @@ char **ast_bt_get_symbols(void **addresses, size_t num_frames) continue; } + /* file can possibly be null even with a success result from bfd_find_nearest_line */ + file = file ? file : ""; + /* Stack trace output */ found++; if ((lastslash = strrchr(file, '/'))) {