Explorar el Código

Fix a null-pointer deref when writing geoip stats

Found by coverity; CID 1327892.
Nick Mathewson hace 10 años
padre
commit
4604b3ab19
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  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")) {