]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 364635 via svnmerge from
authorMark Murawki <markm@intellasoft.net>
Mon, 30 Apr 2012 16:43:11 +0000 (16:43 +0000)
committerMark Murawki <markm@intellasoft.net>
Mon, 30 Apr 2012 16:43:11 +0000 (16:43 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r364635 | markm | 2012-04-30 11:51:12 -0400 (Mon, 30 Apr 2012) | 10 lines

  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/10@364650 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/logger.c

index 91d716ce0c499a66ab9356def18bfb29f79a2e5d..fcb13a9917cb6ab139ed9fd78109f911e40d96d5 100644 (file)
@@ -1374,6 +1374,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, '/'))) {