mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-30 12:01:03 +00:00
fix possible nul pointer indirection crash.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24485 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3cb6113e8e
commit
b8b3077a8d
1 changed files with 15 additions and 4 deletions
|
@ -380,14 +380,25 @@ static void find_address (bfd *abfd, asection *section,
|
||||||
if (bfd_find_nearest_line (abfd, section, info->symbols,
|
if (bfd_find_nearest_line (abfd, section, info->symbols,
|
||||||
address - vma, &fileName, &functionName, &line))
|
address - vma, &fileName, &functionName, &line))
|
||||||
{
|
{
|
||||||
GSFunctionInfo *fi;
|
GSFunctionInfo *fi;
|
||||||
|
NSString *file = nil;
|
||||||
|
NSString *func = nil;
|
||||||
|
|
||||||
|
if (fileName != 0)
|
||||||
|
{
|
||||||
|
file = [NSString stringWithCString: fileName
|
||||||
|
encoding: [NSString defaultCStringEncoding]];
|
||||||
|
}
|
||||||
|
if (functionName != 0)
|
||||||
|
{
|
||||||
|
func = [NSString stringWithCString: functionName
|
||||||
|
encoding: [NSString defaultCStringEncoding]];
|
||||||
|
}
|
||||||
fi = [GSFunctionInfo alloc];
|
fi = [GSFunctionInfo alloc];
|
||||||
fi = [fi initWithModule: info->module
|
fi = [fi initWithModule: info->module
|
||||||
address: info->theAddress
|
address: info->theAddress
|
||||||
file: [NSString stringWithCString: fileName
|
file: file
|
||||||
encoding: [NSString defaultCStringEncoding]]
|
function: func
|
||||||
function: [NSString stringWithUTF8String: functionName]
|
|
||||||
line: line];
|
line: line];
|
||||||
[fi autorelease];
|
[fi autorelease];
|
||||||
info->theInfo = fi;
|
info->theInfo = fi;
|
||||||
|
|
Loading…
Reference in a new issue