diff options
-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; } |