Show
Ignore:
Timestamp:
2003-04-08 03:21:01 (6 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

Try to catch a couple of cases in which parameters for malloc calls
could overflow. Thanks to Timo Sirainen for the heads-up.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • browser.c

    r3181 r3375  
    798798          { 
    799799            *numfiles = menu->tagged; 
    800             tfiles = safe_malloc (*numfiles * sizeof (char *)); 
     800            tfiles = safe_calloc (*numfiles, sizeof (char *)); 
    801801            for (i = 0, j = 0; i < state.entrylen; i++) 
    802802            { 
     
    815815          { 
    816816            *numfiles = 1; 
    817             tfiles = safe_malloc (*numfiles * sizeof (char *)); 
     817            tfiles = safe_calloc (*numfiles, sizeof (char *)); 
    818818            mutt_expand_path (f, flen); 
    819819            tfiles[0] = safe_strdup (f);