Sfoglia il codice sorgente

Fix a null-pointer deref when writing geoip stats

Found by coverity; CID 1327892.
Nick Mathewson 8 anni fa
parent
commit
4604b3ab19
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. 2 0
      src/or/geoip.c

+ 2 - 0
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")) {