diff options
author | MyoungJune Park <mj2004.park@samsung.com> | 2017-11-03 11:39:05 +0900 |
---|---|---|
committer | MyoungJune Park <mj2004.park@samsung.com> | 2017-11-03 11:39:05 +0900 |
commit | bbfe12cb8b0f44abdd9ebdf48c5c72bbcd55266e (patch) | |
tree | 6ab3f6b8b239dd1e43d3b2b91c5e55b2dabe1b57 | |
parent | e6011c76ced62504364024c2bfd856deab1f65af (diff) | |
download | factory-reset-bbfe12cb8b0f44abdd9ebdf48c5c72bbcd55266e.tar.gz factory-reset-bbfe12cb8b0f44abdd9ebdf48c5c72bbcd55266e.tar.bz2 factory-reset-bbfe12cb8b0f44abdd9ebdf48c5c72bbcd55266e.zip |
add exception handler for sscanfsubmit/tizen_4.0/20171103.031359accepted/tizen/4.0/unified/20171109.065800
Change-Id: I2f6576898e17ef093d5189bc920275b087bba5b1
-rw-r--r-- | src/rstsmack.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rstsmack.c b/src/rstsmack.c index 38d18d5..15fefa0 100644 --- a/src/rstsmack.c +++ b/src/rstsmack.c @@ -83,6 +83,11 @@ static int parse_and_set(const char *srcfile) while (fgets(linebuf, sizeof(linebuf), fp)) { plabel = strstr(linebuf, " access="); + + if (plabel >= SMACK_LABEL_LEN) { // handling "The maximum input length is not specified" + fclose(fp); + return -1; + } if (plabel && linebuf != plabel) { *plabel = '\0'; strncpy(pathname, linebuf, sizeof(pathname)); @@ -130,6 +135,7 @@ static int parse_and_set(const char *srcfile) LOGINFO("\n"); } + fclose(fp); return 0; } |