summaryrefslogtreecommitdiff
path: root/src/bin/edje/edje_decc.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2013-08-05 10:41:16 +0100
committerChris Michael <cp.michael@samsung.com>2013-08-05 10:41:16 +0100
commit42496ac4ea0413af0415b239bd76c88a75948c26 (patch)
treefcc701750507f71d438ddaf0bcf5c6e5c9c36d45 /src/bin/edje/edje_decc.c
parent62401c257a562c5fb20b9206be862de23ec7315c (diff)
fopen can fail. check file is open before trying to write to it.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/bin/edje/edje_decc.c')
-rw-r--r--src/bin/edje/edje_decc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/bin/edje/edje_decc.c b/src/bin/edje/edje_decc.c
index 774885d0c2..2065d90a82 100644
--- a/src/bin/edje/edje_decc.c
+++ b/src/bin/edje/edje_decc.c
@@ -438,10 +438,13 @@ output(void)
438 ERR("potential security violation. attempt to write in parent dir."); 438 ERR("potential security violation. attempt to write in parent dir.");
439 exit (-1); 439 exit (-1);
440 } 440 }
441 f = fopen(out, "wb"); 441 if ((f = fopen(out, "wb")))
442 fprintf(f, "#!/bin/sh\n"); 442 {
443 fprintf(f, "%s $@ -id . -fd . %s -o %s.edj\n", edje_file->compiler, sf->name, outdir); 443 fprintf(f, "#!/bin/sh\n");
444 fclose(f); 444 fprintf(f, "%s $@ -id . -fd . %s -o %s.edj\n",
445 edje_file->compiler, sf->name, outdir);
446 fclose(f);
447 }
445 448
446 WRN("*** CAUTION ***\n" 449 WRN("*** CAUTION ***\n"
447 "Please check the build script for anything malicious " 450 "Please check the build script for anything malicious "