Show
Ignore:
Timestamp:
2001-01-08 08:57:20 (8 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

Fix and/or check more fishy code.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • browser.c

    r2237 r2238  
    177177      if (folder->ff->st != NULL) 
    178178      { 
    179         strcat (fn, S_ISLNK (folder->ff->st->st_mode) ? "@" :  
     179        strcat (fn, S_ISLNK (folder->ff->st->st_mode) ? "@" :           /* __STRCAT_CHECKED__ */ 
    180180                (S_ISDIR (folder->ff->st->st_mode) ? "/" :  
    181181                 ((folder->ff->st->st_mode & S_IXUSR) != 0 ? "*" : ""))); 
     
    567567      { 
    568568        getcwd (LastDir, sizeof (LastDir)); 
    569         strcat (LastDir, "/"); 
     569        strcat (LastDir, "/");  /* __STRCAT_CHECKED__ */ 
    570570        strncat (LastDir, f, i); 
    571571      } 
     
    683683            { 
    684684              if (mutt_strcmp ("..", LastDir + mutt_strlen (LastDir) - 2) == 0) 
    685                 strcat (LastDir, "/.."); 
     685                strcat (LastDir, "/..");        /* __STRCAT_CHECKED__ */ 
    686686              else 
    687687              { 
     
    695695                    LastDir[1] = 0; 
    696696                  else 
    697                     strcat (LastDir, "/.."); 
     697                    strcat (LastDir, "/..");    /* __STRCAT_CHECKED__ */ 
    698698                } 
    699699              } 
     
    701701            else if (buffy) 
    702702            { 
    703               sprintf (LastDir, "%s", state.entry[menu->current].name); 
     703              strfcpy (LastDir, state.entry[menu->current].name, sizeof (LastDir)); 
    704704              mutt_expand_path (LastDir, sizeof (LastDir)); 
    705705            } 
     
    727727#endif 
    728728            else 
    729               sprintf (LastDir + mutt_strlen (LastDir), "/%s", 
    730                        state.entry[menu->current].name); 
     729            { 
     730              char tmp[_POSIX_PATH_MAX]; 
     731              snprintf (tmp, sizeof (tmp), "%s/%s", LastDir, state.entry[menu->current].name); 
     732              strfcpy (LastDir, tmp, sizeof (LastDir)); 
     733            } 
    731734 
    732735            destroy_state (&state);