aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-03-06 12:04:58 -0500
committerNick Mathewson <nickm@torproject.org>2017-03-06 12:04:58 -0500
commit88b91d775345037f1d743ecc4d7d392b15d501bb (patch)
tree8f7204e4759ca09cc185b7af369ce8051f8ad271 /src/or
parent2c8d2cab13f8acf35cebc467b3607d04b9f87a4b (diff)
parentae91e64fa846d2861a6627fbd018665840fd7dd7 (diff)
downloadtor-88b91d775345037f1d743ecc4d7d392b15d501bb.tar.gz
tor-88b91d775345037f1d743ecc4d7d392b15d501bb.zip
Merge remote-tracking branch 'ahf/bugs/20988'
Diffstat (limited to 'src/or')
-rw-r--r--src/or/dirserv.c4
-rw-r--r--src/or/geoip.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index f01668adcb..2c3ce100df 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -2701,7 +2701,7 @@ dirserv_read_measured_bandwidths(const char *from_file,
return -1;
}
- if (!fgets(line, sizeof(line), fp)
+ if (!tor_fgets(line, sizeof(line), fp)
|| !strlen(line) || line[strlen(line)-1] != '\n') {
log_warn(LD_DIRSERV, "Long or truncated time in bandwidth file: %s",
escaped(line));
@@ -2731,7 +2731,7 @@ dirserv_read_measured_bandwidths(const char *from_file,
while (!feof(fp)) {
measured_bw_line_t parsed_line;
- if (fgets(line, sizeof(line), fp) && strlen(line)) {
+ if (tor_fgets(line, sizeof(line), fp) && strlen(line)) {
if (measured_bw_line_parse(&parsed_line, line) != -1) {
/* Also cache the line for dirserv_get_bandwidth_for_router() */
dirserv_cache_measured_bw(&parsed_line, file_time);
diff --git a/src/or/geoip.c b/src/or/geoip.c
index 74811ea643..a8dc807c19 100644
--- a/src/or/geoip.c
+++ b/src/or/geoip.c
@@ -346,7 +346,7 @@ geoip_load_file(sa_family_t family, const char *filename)
(family == AF_INET) ? "IPv4" : "IPv6", filename);
while (!feof(f)) {
char buf[512];
- if (fgets(buf, (int)sizeof(buf), f) == NULL)
+ if (tor_fgets(buf, (int)sizeof(buf), f) == NULL)
break;
crypto_digest_add_bytes(geoip_digest_env, buf, strlen(buf));
/* FFFF track full country name. */