embryo_cc: ++safty code

Summary:
This patch is increasing safty code by handling following case.

sc_compile > OH!! there is uninitialized loacal variable "outfname"!! >
setopt > about > longjmp > setjmp returns 3 > goto cleanup >

then uninitialized data is read from local variable "outfname".

Reviewers: raster, Hermet, jsuya, herb

Reviewed By: jsuya

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12074
This commit is contained in:
Shinwoo Kim 2020-08-05 14:52:50 +09:00
parent 26b50c91f8
commit bab3f870b8
1 changed files with 6 additions and 3 deletions

View File

@ -266,7 +266,7 @@ sc_compile(int argc, char *argv[])
void *inpfmark;
char lcl_ctrlchar;
int lcl_packstr, lcl_needsemicolon, lcl_tabsize;
Eina_Tmpstr *outfname;
Eina_Tmpstr *outfname = NULL;
/* set global variables to their initial value */
binf = NULL;
@ -398,8 +398,11 @@ sc_compile(int argc, char *argv[])
} /* if */
if (outf)
sc_closeasm(outf);
unlink(outfname);
eina_tmpstr_del(outfname);
if (outfname)
{
unlink(outfname);
eina_tmpstr_del(outfname);
}
if (binf)
sc_closebin(binf, errnum != 0);