summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMyoungJune Park <mj2004.park@samsung.com>2017-12-06 17:24:42 +0900
committerMyoungJune Park <mj2004.park@samsung.com>2017-12-06 17:24:42 +0900
commitb09f547e269fa2a0caef2c522ca74ce8fc39a2bf (patch)
tree0805bef1fb95d45e83c6aa0401713ae4ab1e6868
parent9217cf5c8330d81bf099014207dadeefc419c4ae (diff)
parentbbfe12cb8b0f44abdd9ebdf48c5c72bbcd55266e (diff)
downloadfactory-reset-submit/tizen/20171206.083137.tar.gz
factory-reset-submit/tizen/20171206.083137.tar.bz2
factory-reset-submit/tizen/20171206.083137.zip
Merge branch 'tizen_4.0' into tizensubmit/tizen/20171206.083137
-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;
}