diff options
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/or/router.c b/src/or/router.c index bb63dc205e..64267f242c 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -1847,18 +1847,18 @@ load_stats_file(const char *filename, const char *end_line, time_t after, if (start != contents) start++; /* Avoid infinite loops. */ if (!(start = strstr(start, end_line))) - goto err; - if (strlen(start) < strlen(end_line) + sizeof(timestr)) - goto err; + goto notfound; + if (strlen(start) < strlen(end_line) + 1 + sizeof(timestr)) + goto notfound; strlcpy(timestr, start + 1 + strlen(end_line), sizeof(timestr)); if (parse_iso_time(timestr, &written) < 0) - goto err; - } while (written < after); + goto notfound; + } while (written <= after); *out = tor_malloc(strlen(start)); strlcpy(*out, start, strlen(start)); r = 1; } - err: + notfound: tor_free(contents); break; case FN_NOENT: @@ -2011,8 +2011,6 @@ extrainfo_dump_to_string(char *s, size_t maxlen, extrainfo_t *extrainfo, extrainfo_free(ei_tmp); } - log_info(LD_GENERAL, "Done with dumping our extra-info descriptor."); - return (int)strlen(s)+1; } |