diff --git modules/comment/comment.module modules/comment/comment.module
index e332bb2..875e411 100644
--- modules/comment/comment.module
+++ modules/comment/comment.module
@@ -1257,14 +1257,20 @@ function comment_node_delete($node) {
  * Implements hook_node_update_index().
  */
 function comment_node_update_index($node) {
-  $mode = variable_get('comment_default_mode_' . $node->type, COMMENT_MODE_THREADED);
-  $comments_per_page = variable_get('comment_default_per_page_' . $node->type, 50);
-  if ($node->comment && $cids = comment_get_thread($node, $mode, $comments_per_page)) {
-    $comments = comment_load_multiple($cids);
-    comment_prepare_thread($comments);
-    $build = comment_view_multiple($comments, $node);
+  // Only add comments to the search index if anonymous users have permission
+  // to access comments.
+  $permissions = user_role_permissions(array(DRUPAL_ANONYMOUS_RID => ''));
+  if (isset($permissions[DRUPAL_ANONYMOUS_RID]['access comments'])) {
+    $mode = variable_get('comment_default_mode_' . $node->type, COMMENT_MODE_THREADED);
+    $comments_per_page = variable_get('comment_default_per_page_' . $node->type, 50);
+    if ($node->comment && $cids = comment_get_thread($node, $mode, $comments_per_page)) {
+      $comments = comment_load_multiple($cids);
+      comment_prepare_thread($comments);
+      $build = comment_view_multiple($comments, $node);
+      return drupal_render($build);
+    }
   }
-  return drupal_render($build);
+  return '';
 }
 
 /**
@@ -1279,9 +1285,11 @@ function comment_update_index() {
  * Implements hook_node_search_result().
  */
 function comment_node_search_result($node) {
-  if ($node->comment != COMMENT_NODE_HIDDEN) {
-    $comments = db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = :nid', array('nid' => $node->nid))->fetchField();
-    return format_plural($comments, '1 comment', '@count comments');
+  if (user_access('access comments')) {
+    if ($node->comment != COMMENT_NODE_HIDDEN) {
+      $comments = db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = :nid', array('nid' => $node->nid))->fetchField();
+      return format_plural($comments, '1 comment', '@count comments');
+    }
   }
   return '';
 }
diff --git modules/search/search.test modules/search/search.test
index 6e7f033..85a3707 100644
--- modules/search/search.test
+++ modules/search/search.test
@@ -519,12 +519,7 @@ class SearchCommentTestCase extends DrupalWebTestCase {
     // Allow anonymous users to search content.
     $edit = array(
       DRUPAL_ANONYMOUS_RID . '[search content]' => 1,
-      // @todo Comments are added to search index without checking first whether
-      //   anonymous users are allowed to access comments.
       DRUPAL_ANONYMOUS_RID . '[access comments]' => 1,
-      // @todo Without this permission, "Login or register to post comments" is
-      //   added to the search index.  Comment.module is not guilty; that text
-      //   seems to be added via node links.
       DRUPAL_ANONYMOUS_RID . '[post comments]' => 1,
     );
     $this->drupalPost('admin/people/permissions', $edit, t('Save permissions'));
@@ -576,6 +571,43 @@ class SearchCommentTestCase extends DrupalWebTestCase {
     $this->drupalPost('', $edit, t('Search'));
     $this->assertNoText($comment_body, t('Comment body text not found in search results.'));
   }
+
+
+  /**
+   * Verify that comments are not indexed when permission for anonymous role
+   * is not enabled.
+   */
+  function testSearchResultsCommentNoAccess() {
+    $comment_body = 'Test comment body';
+
+    variable_set('comment_preview_article', DRUPAL_OPTIONAL);
+
+    // Allow anonymous users to search content.
+    $edit = array(
+      DRUPAL_ANONYMOUS_RID . '[search content]' => 1,
+    );
+    $this->drupalPost('admin/people/permissions', $edit, t('Save permissions'));
+
+    // Create a node.
+    $node = $this->drupalCreateNode(array('type' => 'article'));
+    // Post a comment using 'Full HTML' text format.
+    $edit_comment = array();
+    $edit_comment['subject'] = 'Test comment subject';
+    $edit_comment['comment_body[' . LANGUAGE_NONE . '][0][value]'] = '<h1>' . $comment_body . '</h1>';
+    $this->drupalPost('comment/reply/' . $node->nid, $edit_comment, t('Save'));
+
+    // Invoke search index update.
+    $this->drupalLogout();
+    $this->cronRun();
+
+    // Search for the comment subject.
+    $edit = array(
+      'search_block_form' => "'" . $edit_comment['subject'] . "'",
+    );
+    $this->drupalPost('', $edit, t('Search'));
+    $this->assertNoText($node->title, t('Node not found in search results.'));
+    $this->assertNoText($edit_comment['subject'], t('Comment subject not found in search results.'));
+  }
 }
 
 /**
