summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMyoungJune Park <mj2004.park@samsung.com>2017-11-03 11:39:05 +0900
committerMyoungJune Park <mj2004.park@samsung.com>2017-11-03 11:39:05 +0900
commitbbfe12cb8b0f44abdd9ebdf48c5c72bbcd55266e (patch)
tree6ab3f6b8b239dd1e43d3b2b91c5e55b2dabe1b57
parente6011c76ced62504364024c2bfd856deab1f65af (diff)
downloadfactory-reset-submit/tizen_4.0/20171103.031359.tar.gz
factory-reset-submit/tizen_4.0/20171103.031359.tar.bz2
factory-reset-submit/tizen_4.0/20171103.031359.zip
Change-Id: I2f6576898e17ef093d5189bc920275b087bba5b1
-rw-r--r--src/rstsmack.c6
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;
}