Correct read length of silencers file (#6909)
Chris Akritidis committed
Sep 22, 2019 at 18:36 UTC
60e21cda913e889e7ce83e915830cc42798be37b
1 file changed
+1
-1
health/health.c
+1
-1
@@ -51,7 +51,7 @@ void health_silencers_init(void) {
51
off_t length = (off_t) ftell(fd);
52
fseek(fd, 0 , SEEK_SET);
53
54
- if (length && length < HEALTH_SILENCERS_MAX_FILE_LEN) {
54
+ if (length > 0 && length < HEALTH_SILENCERS_MAX_FILE_LEN) {
55
char *str = mallocz((length+1)* sizeof(char));
56
if(str) {
57
size_t copied;