summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Haines <richard_c_haines@btinternet.com>2015-11-23 15:56:48 +0000
committerandroid-build-merger <android-build-merger@google.com>2015-11-23 15:56:48 +0000
commit3e08682ba440ab3ae74e7b19878f7d7ed95e2407 (patch)
tree0867f39f27101ec71af7b2f67b9081f25cc821d0
parent4caaec565181b1ee6d7ed025239a8834943c1316 (diff)
parentbe5f860effa9aff2afb397703f64de7acf92ad6d (diff)
downloadlibselinux-3e08682ba440ab3ae74e7b19878f7d7ed95e2407.tar.gz
Correct line count for property and service contexts files
am: be5f860eff * commit 'be5f860effa9aff2afb397703f64de7acf92ad6d': Correct line count for property and service contexts files
-rw-r--r--src/label_android_property.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/label_android_property.c b/src/label_android_property.c
index af06c4a..d7ab4ba 100644
--- a/src/label_android_property.c
+++ b/src/label_android_property.c
@@ -132,7 +132,7 @@ static int init(struct selabel_handle *rec, const struct selinux_opt *opts,
const char *path = NULL;
FILE *fp;
char line_buf[BUFSIZ];
- unsigned int lineno = 0, maxnspec, pass;
+ unsigned int lineno, maxnspec, pass;
int status = -1;
struct stat sb;
@@ -166,6 +166,7 @@ static int init(struct selabel_handle *rec, const struct selinux_opt *opts,
maxnspec = UINT_MAX / sizeof(spec_t);
for (pass = 0; pass < 2; pass++) {
data->nspec = 0;
+ lineno = 0;
while (fgets(line_buf, sizeof(line_buf) - 1, fp)
&& data->nspec < maxnspec) {