summaryrefslogtreecommitdiff
path: root/src/bin/edje
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-08-27 17:41:12 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-08-27 17:47:34 +0900
commita427fc46f77e54550ec34e490100a2736dee7ec1 (patch)
tree6bd94ab1daeaf0613e1b8948f433e34c2babdeb7 /src/bin/edje
parent27ae94596f10d34e00241ab61896053fbe8c7686 (diff)
edje_decc - fix strrchr null return case
fix CID 1039342
Diffstat (limited to 'src/bin/edje')
-rw-r--r--src/bin/edje/edje_decc.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/bin/edje/edje_decc.c b/src/bin/edje/edje_decc.c
index 9f87771ada..f923f4fa9d 100644
--- a/src/bin/edje/edje_decc.c
+++ b/src/bin/edje/edje_decc.c
@@ -328,7 +328,7 @@ output(void)
328 INF("Output Image: %s", out); 328 INF("Output Image: %s", out);
329 pp = strdup(out); 329 pp = strdup(out);
330 p = strrchr(pp, '/'); 330 p = strrchr(pp, '/');
331 *p = 0; 331 if (p) *p = 0;
332 if (strstr(pp, "../")) 332 if (strstr(pp, "../"))
333 { 333 {
334 ERR("Potential security violation. attempt to write in parent dir."); 334 ERR("Potential security violation. attempt to write in parent dir.");
@@ -359,7 +359,7 @@ output(void)
359 INF("Output Source File: %s", out); 359 INF("Output Source File: %s", out);
360 pp = strdup(out); 360 pp = strdup(out);
361 p = strrchr(pp, '/'); 361 p = strrchr(pp, '/');
362 *p = 0; 362 if (p) *p = 0;
363 if (strstr(pp, "../")) 363 if (strstr(pp, "../"))
364 { 364 {
365 ERR("Potential security violation. attempt to write in parent dir."); 365 ERR("Potential security violation. attempt to write in parent dir.");
@@ -410,7 +410,7 @@ output(void)
410 INF("Output Font: %s", out); 410 INF("Output Font: %s", out);
411 pp = strdup(out); 411 pp = strdup(out);
412 p = strrchr(pp, '/'); 412 p = strrchr(pp, '/');
413 *p = 0; 413 if (p) *p = 0;
414 if (strstr(pp, "../")) 414 if (strstr(pp, "../"))
415 { 415 {
416 ERR("Potential security violation. attempt to write in parent dir."); 416 ERR("Potential security violation. attempt to write in parent dir.");
@@ -501,7 +501,7 @@ output(void)
501 snprintf(out1, sizeof(out1), "%s/%s", outdir, sample->snd_src); 501 snprintf(out1, sizeof(out1), "%s/%s", outdir, sample->snd_src);
502 pp = strdup(out1); 502 pp = strdup(out1);
503 p = strrchr(pp, '/'); 503 p = strrchr(pp, '/');
504 *p = 0; 504 if (p) *p = 0;
505 if (strstr(pp, "../")) 505 if (strstr(pp, "../"))
506 { 506 {
507 ERR("Potential security violation. attempt to write in parent dir."); 507 ERR("Potential security violation. attempt to write in parent dir.");
@@ -548,12 +548,7 @@ output(void)
548 snprintf(out1, sizeof(out1), "%s/%s", outdir, sample->src); 548 snprintf(out1, sizeof(out1), "%s/%s", outdir, sample->src);
549 pp = strdup(out1); 549 pp = strdup(out1);
550 p = strrchr(pp, '/'); 550 p = strrchr(pp, '/');
551 if (!p) 551 if (p) *p = 0;
552 {
553 ERR("Cannot find '/' in file");
554 exit(-1);
555 }
556 *p = 0;
557 if (strstr(pp, "../")) 552 if (strstr(pp, "../"))
558 { 553 {
559 ERR("Potential security violation. attempt to write in parent dir."); 554 ERR("Potential security violation. attempt to write in parent dir.");