forked from enlightenment/efl
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:
parent
26b50c91f8
commit
bab3f870b8
|
@ -266,7 +266,7 @@ sc_compile(int argc, char *argv[])
|
||||||
void *inpfmark;
|
void *inpfmark;
|
||||||
char lcl_ctrlchar;
|
char lcl_ctrlchar;
|
||||||
int lcl_packstr, lcl_needsemicolon, lcl_tabsize;
|
int lcl_packstr, lcl_needsemicolon, lcl_tabsize;
|
||||||
Eina_Tmpstr *outfname;
|
Eina_Tmpstr *outfname = NULL;
|
||||||
|
|
||||||
/* set global variables to their initial value */
|
/* set global variables to their initial value */
|
||||||
binf = NULL;
|
binf = NULL;
|
||||||
|
@ -398,8 +398,11 @@ sc_compile(int argc, char *argv[])
|
||||||
} /* if */
|
} /* if */
|
||||||
if (outf)
|
if (outf)
|
||||||
sc_closeasm(outf);
|
sc_closeasm(outf);
|
||||||
|
if (outfname)
|
||||||
|
{
|
||||||
unlink(outfname);
|
unlink(outfname);
|
||||||
eina_tmpstr_del(outfname);
|
eina_tmpstr_del(outfname);
|
||||||
|
}
|
||||||
if (binf)
|
if (binf)
|
||||||
sc_closebin(binf, errnum != 0);
|
sc_closebin(binf, errnum != 0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue