소스 검색

bugfix: alice would crash if bob advertised 0 intro points

svn:r1559
Roger Dingledine 21 년 전
부모
커밋
3e7c8a40bc
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      src/or/rendclient.c

+ 4 - 0
src/or/rendclient.c

@@ -284,6 +284,10 @@ char *rend_client_get_random_intro(char *query) {
     smartlist_add(sl,entry->parsed->intro_points[i]);
 
   choice = smartlist_choose(sl);
+  if(!choice) {
+    smartlist_free(sl);
+    return NULL;
+  }
   nickname = tor_strdup(choice);
   smartlist_free(sl);
   return nickname;