<<< Date Index >>>     <<< Thread Index >>>

Read of uninitialized pointer



Hey all,

One of my users reported a crash, and after looking into it I came up
with this obviously looking fix:

--- mutt-1.5.8/curs_main.c
+++ mutt-1.5.8/curs_main.c
@@ -173,7 +173,7 @@
 { 
   HEADER *h = Context->hdrs[Context->v2r[index_no]];

-  if (h->pair)
+  if (h && h->pair)
     return h->pair;

   mutt_set_header_color (Context, h);

mutt_set_header_color() will behave correctly when called with h ==
NULL, so this patch should be correct.

-- 
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic
 and totally illogical, with just a little bit more effort?"
                                -- A. P. J.