]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
bugfix: alice would crash if bob advertised 0 intro points
authorRoger Dingledine <arma@torproject.org>
Thu, 8 Apr 2004 03:18:03 +0000 (03:18 +0000)
committerRoger Dingledine <arma@torproject.org>
Thu, 8 Apr 2004 03:18:03 +0000 (03:18 +0000)
svn:r1559

src/or/rendclient.c

index 540fa2b3f8d75ef5ff5822617d1d8d59695660c9..aa32ead26fa4c464af399e56b04b1596a7cb38c4 100644 (file)
@@ -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;