소스 검색

Fix a null-pointer deref when writing geoip stats

Found by coverity; CID 1327892.
Nick Mathewson 8 년 전
부모
커밋
4604b3ab19
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  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")) {