aboutsummaryrefslogtreecommitdiffstats
path: root/key2root-rmkey.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--key2root-rmkey.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/key2root-rmkey.c b/key2root-rmkey.c
index c55468f..1165435 100644
--- a/key2root-rmkey.c
+++ b/key2root-rmkey.c
@@ -116,8 +116,11 @@ loadandremove(int fd, char **datap, size_t *lenp, size_t *sizep, const char **ke
removekeys(*datap, lenp, &rhead, &rhead2, &lineno, path, keys, nkeysp);
}
- if (rhead != *lenp)
+ if (rhead != *lenp) {
fprintf(stderr, "%s: file truncated: %s\n", argv0, path);
+ if (memchr(&(*datap)[rhead], '\0', *lenp - rhead))
+ fprintf(stderr, "%s: NUL byte found in %s on line %zu\n", argv0, path, lineno + 1);
+ }
}