Index: modules/comment/comment.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.admin.inc,v
retrieving revision 1.49
diff -u -r1.49 comment.admin.inc
--- modules/comment/comment.admin.inc	11 Sep 2010 01:47:14 -0000	1.49
+++ modules/comment/comment.admin.inc	12 Sep 2010 19:35:30 -0000
@@ -69,49 +69,49 @@
   );
 
   $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);
+    $access = (node_access('view', $nodes[$comment->nid]) === TRUE);
+    $data_subject = array(
+      '#type' => 'link',
+      '#title' => $comment->subject,
+      '#href' => 'comment/' . $comment->cid,
+      '#options' => array('attributes' => array('title' => truncate_utf8($comment->comment_body[LANGUAGE_NONE][0]['value'], 128)), 'fragment' => 'comment-' . $comment->cid),
+    );
+    $data_posted_in = array(
+      '#type' => 'link',
+      '#title' => $nodes[$comment->nid]->title,
+      '#href' => 'node/' . $comment->nid,
+    );
     $options[$comment->cid] = array(
       'subject' => array(
-        'data' => array(
-          '#type' => 'link',
-          '#title' => $comment->subject,
-          '#href' => 'comment/' . $comment->cid,
-          '#options' => array('attributes' => array('title' => truncate_utf8($comment->comment_body[LANGUAGE_NONE][0]['value'], 128)), 'fragment' => 'comment-' . $comment->cid),
-        ),
+        'data' => $access ? $data_subject : $comment->subject . ' (' . t('Access denied') . ')',
       ),
       'author' => theme('username', array('account' => $comment)),
       'posted_in' => array(
-        'data' => array(
-          '#type' => 'link',
-          '#title' => $comment->node_title,
-          '#href' => 'node/' . $comment->nid,
-        ),
+        'data' => $access ? $data_posted_in : t('Access denied'),
       ),
       'changed' => format_date($comment->changed, 'short'),
       'operations' => array(
Index: modules/comment/comment.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.test,v
retrieving revision 1.89
diff -u -r1.89 comment.test
--- modules/comment/comment.test	30 Aug 2010 00:22:03 -0000	1.89
+++ modules/comment/comment.test	12 Sep 2010 19:35:31 -0000
@@ -938,6 +938,14 @@
     $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->assertText($comments[0]->subject . ' (' . t('Access denied') . ')', t('No link to the comment found'));
+    $this->assertText($comments[1]->subject . ' (' . t('Access denied') . ')', t('No link to the comment found'));
+    $this->assertNoText($this->node->title, t('No link to the content found'));
+    
     // Delete multiple comments in one operation.
     $edit = array(
       'operation' => 'delete',
