[tor-commits] [tor/master] Fix a null-pointer deref when writing geoip stats

nickm at torproject.org nickm at torproject.org
Fri Dec 18 15:06:11 UTC 2015


commit 4604b3ab197af5f6d0d407bd2dbe4b0d6a14e22b
Author: Nick Mathewson <nickm at torproject.org>
Date:   Fri Dec 18 10:00:44 2015 -0500

    Fix a null-pointer deref when writing geoip stats
    
    Found by coverity; CID 1327892.
---
 src/or/geoip.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/or/geoip.c b/src/or/geoip.c
index 3ef1672..26030ae 100644
--- a/src/or/geoip.c
+++ b/src/or/geoip.c
@@ -1279,6 +1279,8 @@ geoip_dirreq_stats_write(time_t now)
 
   /* Generate history string .*/
   str = geoip_format_dirreq_stats(now);
+  if (! str)
+    goto done;
 
   /* Write dirreq-stats string to disk. */
   if (!check_or_create_data_subdir("stats")) {





More information about the tor-commits mailing list