File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ DLSyms* dlSymsInit(const char* libPath)
106
106
int i ;
107
107
struct stat st ;
108
108
DLSyms * pSyms = (DLSyms * )dlAllocMem (sizeof (DLSyms ));
109
+ Elf_Shdr * pS ;
109
110
memset (pSyms , 0 , sizeof (DLSyms ));
110
111
pSyms -> file = open (libPath , O_RDONLY );
111
112
stat (libPath , & st );
@@ -125,7 +126,7 @@ DLSyms* dlSymsInit(const char* libPath)
125
126
pMem = (unsigned char * )pSyms -> pElf_Ehdr ;
126
127
127
128
/* traverse section headers */
128
- Elf_Shdr * pS = (Elf_Shdr * ) ( pMem + pSyms -> pElf_Ehdr -> e_shoff );
129
+ pS = (Elf_Shdr * ) ( pMem + pSyms -> pElf_Ehdr -> e_shoff );
129
130
/* skip section 0 which is always zero due to the Elf standard. */
130
131
for (i = 1 ; i < pSyms -> pElf_Ehdr -> e_shnum ; i ++ )
131
132
{
@@ -169,10 +170,12 @@ int dlSymsCount(DLSyms* pSyms)
169
170
170
171
const char * dlSymsName (DLSyms * pSyms , int index )
171
172
{
173
+ int str_index ;
174
+
172
175
if (!pSyms || !pSyms -> pSymTab || index < 0 || index >= pSyms -> nSymbols )
173
176
return NULL ;
174
-
175
- int str_index = pSyms -> pSymTab [index ].st_name ;
177
+
178
+ str_index = pSyms -> pSymTab [index ].st_name ;
176
179
if (str_index < 0 || str_index >= pSyms -> strTabSize )
177
180
return NULL ;
178
181
return & pSyms -> pStrTab [str_index ];
You can’t perform that action at this time.
0 commit comments