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

mutt/2153: uninitialized variable flags in hdrline.c



>Number:         2153
>Notify-List:    
>Category:       mutt
>Synopsis:       uninitialized variable flags in hdrline.c
>Confidential:   no
>Severity:       normal
>Priority:       medium
>Responsible:    mutt-dev
>State:          open
>Keywords:       
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 16 12:18:40 +0100 2005
>Originator:     Vincent Lefevre
>Release:        
>Organization:
>Environment:
>Description:
hdrline.c contains:

    case 'X':
      {
        int count, flags;

        if (hdr->content->parts)
          count = mutt_count_body_parts(hdr, flags);
        else
        {
          mutt_parse_mime_message(ctx, hdr);
          count = mutt_count_body_parts(hdr, flags);
          mutt_free_body(&hdr->content->parts);
        }

The flags value is passed to mutt_count_body_parts though it has not been 
initialized. I don't know if it is really used or not. Anyway this is incorrect 
(undefined behavior according to the ISO C standard) and one never knows what 
the compiler will do in such a case (e.g. it could possibly detect it and 
generate a trap for security reasons).
>How-To-Repeat:
>Fix:
Initialize flags to the wanted value.
>Add-To-Audit-Trail:

>Unformatted: