mk: remove buggy and unneeded syminit() function (thanks qurstuv)
syminit() attemts to reset the symbol table by freeing all the hash table entries, tho the code is buggy having a obviously use after free bug. as syminit() is only called once in main when it does not contain any symbols, the bug never occured. removing the unneccesary code alltogether.
This commit is contained in:
parent
68571320fa
commit
b878450725
3 changed files with 0 additions and 14 deletions
|
@ -65,7 +65,6 @@ void shprint(char*, Envy*, Bufblock*);
|
|||
Word *stow(char*);
|
||||
void subst(char*, char*, char*, int);
|
||||
void symdel(char*, int);
|
||||
void syminit(void);
|
||||
Symtab *symlook(char*, int, void*);
|
||||
void symstat(void);
|
||||
void symtraverse(int, void(*)(Symtab*));
|
||||
|
|
|
@ -119,7 +119,6 @@ main(int argc, char **argv)
|
|||
if(aflag)
|
||||
iflag = 1;
|
||||
usage();
|
||||
syminit();
|
||||
initenv();
|
||||
usage();
|
||||
|
||||
|
|
|
@ -4,18 +4,6 @@
|
|||
#define HASHMUL 79L /* this is a good value */
|
||||
static Symtab *hash[NHASH];
|
||||
|
||||
void
|
||||
syminit(void)
|
||||
{
|
||||
Symtab **s, *ss;
|
||||
|
||||
for(s = hash; s < &hash[NHASH]; s++){
|
||||
for(ss = *s; ss; ss = ss->next)
|
||||
free((char *)ss);
|
||||
*s = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Symtab *
|
||||
symlook(char *sym, int space, void *install)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue