Red Hat Bugzilla – Bug 109642
PATCH: pstack can segfault on certain binaries in strcpy
Last modified: 2007-11-30 17:06:59 EST
Description of problem:
If pstack attempts to decode a stack in which a given function
signature is more than 256 characters, pstack will segfulat, due to a
buffer overrun error in symAddress
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.create a test program in which function signatures have 256 or more
2.run the program in a loop
3.run pstack on the program, and eventually pstack will segfault
pstack should display as much of each function signature as possible
Created attachment 95877 [details]
patch to avoid buffer overflows in strcpy
This patch replaces the use of strcpy with strncpy and allows callers of
symAddress function to specify the length of the passed in buffer. This avoids
the possibility of bufferoverflows which lead to the reported SIGSEGV
I have fixed the bug without imposing a length limitation on symbols.
Thanks for the report.
An errata has been issued which should help the problem described in this bug report.
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen
this bug report if the solution does not work for you.