Index: modules/comment/comment.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.admin.inc,v
retrieving revision 1.51
diff -u -p -r1.51 comment.admin.inc
--- modules/comment/comment.admin.inc	20 Oct 2010 01:31:06 -0000	1.51
+++ modules/comment/comment.admin.inc	14 Nov 2010 20:53:27 -0000
@@ -71,33 +71,33 @@ function comment_admin_overview($form, &
   );
 
   $query = db_select('comment', 'c')->extend('PagerDefault')->extend('TableSort');
-  $query->join('node', 'n', 'n.nid = c.nid');
-  $query->addField('n', 'title', 'node_title');
   $result = $query
-    ->fields('c', array('cid', 'subject', 'name', 'changed'))
+    ->fields('c', array('cid', 'subject', 'name', 'nid', 'changed'))
     ->condition('c.status', $status)
     ->limit(50)
     ->orderByHeader($header)
     ->execute();
 
-  $cids = array();
+  $cids = $nids = array();
 
   // We collect a sorted list of node_titles during the query to attach to the
   // comments later.
   foreach ($result as $row) {
     $cids[] = $row->cid;
-    $node_titles[] = $row->node_title;
+    $nids[] = $row->nid;
   }
   $comments = comment_load_multiple($cids);
+  // Load every node of comments on this page once.
+  $nodes = node_load_multiple(array_unique($nids));
 
   // Build a table listing the appropriate comments.
   $options = array();
   $destination = drupal_get_destination();
 
   foreach ($comments as $comment) {
-    // Remove the first node title from the node_titles array and attach to
-    // the comment.
-    $comment->node_title = array_shift($node_titles);
+    if (node_access('view', $nodes[$comment->nid]) === FALSE) {
+      continue;
+    }
     $options[$comment->cid] = array(
       'subject' => array(
         'data' => array(
@@ -111,7 +111,7 @@ function comment_admin_overview($form, &
       'posted_in' => array(
         'data' => array(
           '#type' => 'link',
-          '#title' => $comment->node_title,
+          '#title' => $nodes[$comment->nid]->title,
           '#href' => 'node/' . $comment->nid,
         ),
       ),
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.915
diff -u -p -r1.915 comment.module
--- modules/comment/comment.module	14 Nov 2010 20:42:45 -0000	1.915
+++ modules/comment/comment.module	14 Nov 2010 20:53:27 -0000
@@ -1397,7 +1397,9 @@ function comment_access($op, $comment) {
   global $user;
 
   if ($op == 'edit') {
-    return ($user->uid && $user->uid == $comment->uid && $comment->status == COMMENT_PUBLISHED && user_access('edit own comments')) || user_access('administer comments');
+    // Load the node so we can check if the user has access to it.
+    $node = node_load($comment->nid);
+    return node_access('view', $node) && (($user->uid && $user->uid == $comment->uid && $comment->status == COMMENT_PUBLISHED && user_access('edit own comments')) || user_access('administer comments'));
   }
 }
 
Index: modules/comment/comment.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.test,v
retrieving revision 1.92
diff -u -p -r1.92 comment.test
--- modules/comment/comment.test	8 Nov 2010 21:36:45 -0000	1.92
+++ modules/comment/comment.test	14 Nov 2010 20:53:27 -0000
@@ -1021,6 +1021,21 @@ class CommentApprovalTest extends Commen
     $this->drupalPost(NULL, $edit, t('Update'));
     $this->assertText(t('Unapproved comments (@count)', array('@count' => 0)), t('All comments were approved.'));
 
+    // Check node access
+    $this->node->status = 0;
+    node_save($this->node);
+    $this->drupalGet('admin/content/comment');
+    $this->assertNoText($comments[0]->subject, t('No link to the comment found'));
+    $this->assertNoText($comments[1]->subject, t('No link to the comment found'));
+    $this->assertNoText($this->node->title, t('No link to the content found'));
+
+    $this->node->status = 1;
+    node_save($this->node);
+    $this->drupalGet('admin/content/comment');
+    $this->assertText($comments[0]->subject, t('Link to the comment found'));
+    $this->assertText($comments[1]->subject, t('Link to the comment found'));
+    $this->assertText($this->node->title, t('Link to the content found'));
+
     // Delete multiple comments in one operation.
     $edit = array(
       'operation' => 'delete',
