summaryrefslogtreecommitdiff
path: root/src/bin/embryo/embryo_cc_sc1.c
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2020-08-05 14:52:50 +0900
committerShinwoo Kim <cinoo.kim@samsung.com>2020-08-05 14:53:35 +0900
commitbab3f870b8150e05cf2b778e67b1f6be326874a7 (patch)
treea9fcc8369f9f3e4ad5d4cb66c3df63484d36b603 /src/bin/embryo/embryo_cc_sc1.c
parent26b50c91f803d9669edfbc2ab6bad664f86f33a8 (diff)
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
Diffstat (limited to 'src/bin/embryo/embryo_cc_sc1.c')
-rw-r--r--src/bin/embryo/embryo_cc_sc1.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/bin/embryo/embryo_cc_sc1.c b/src/bin/embryo/embryo_cc_sc1.c
index 7595be8299..8f25be75b5 100644
--- a/src/bin/embryo/embryo_cc_sc1.c
+++ b/src/bin/embryo/embryo_cc_sc1.c
@@ -266,7 +266,7 @@ sc_compile(int argc, char *argv[])
266 void *inpfmark; 266 void *inpfmark;
267 char lcl_ctrlchar; 267 char lcl_ctrlchar;
268 int lcl_packstr, lcl_needsemicolon, lcl_tabsize; 268 int lcl_packstr, lcl_needsemicolon, lcl_tabsize;
269 Eina_Tmpstr *outfname; 269 Eina_Tmpstr *outfname = NULL;
270 270
271 /* set global variables to their initial value */ 271 /* set global variables to their initial value */
272 binf = NULL; 272 binf = NULL;
@@ -398,8 +398,11 @@ sc_compile(int argc, char *argv[])
398 } /* if */ 398 } /* if */
399 if (outf) 399 if (outf)
400 sc_closeasm(outf); 400 sc_closeasm(outf);
401 unlink(outfname); 401 if (outfname)
402 eina_tmpstr_del(outfname); 402 {
403 unlink(outfname);
404 eina_tmpstr_del(outfname);
405 }
403 if (binf) 406 if (binf)
404 sc_closebin(binf, errnum != 0); 407 sc_closebin(binf, errnum != 0);
405 408