Changeset 1078 for trunk/dll/walkem.c


Ignore:
Timestamp:
Jul 19, 2008, 6:08:02 AM (17 years ago)
Author:
Steven Levine
Message:

More Fortify infrastructure enhancements
Rework Fortify_SetOwner
Add Fortify_BecomeOwner
Avoid more spurious leak reports

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/walkem.c

    r1077 r1078  
    3131  19 Jun 08 JBS Ticket 227: Allow temporary saving/deleting of the shutdown state of directory containers
    3232  22 Jun 08 GKY Add free_?dir for fortify testing
     33  18 Jul 08 SHL More Fortify support
    3334
    3435***********************************************************************/
     
    221222      return;
    222223    }
     224
     225#   ifdef FORTIFY
     226    Fortify_SetOwner(pld, 1);
     227    Fortify_SetScope(pld, 1);
     228#   endif
     229
    223230    pld->path = xstrdup(psz, pszSrcFile, __LINE__);
    224231    if (!pld->path) {
     
    227234      return;
    228235    }
     236
     237#   ifdef FORTIFY
     238    Fortify_SetOwner(pld->path, 1);
     239    Fortify_SetScope(pld->path, 1);
     240#   endif
    229241
    230242    // Insert at front of list - drop down will sort
     
    355367      if (*s && *s != ';') {
    356368        info = xmalloc(sizeof(LINKDIRS), pszSrcFile, __LINE__);
     369#       ifdef FORTIFY
     370        Fortify_SetOwner(info, 1);
     371        Fortify_SetScope(info, 1);
     372#       endif
    357373        if (info) {
    358374          info->path = xstrdup(s, pszSrcFile, __LINE__);
     
    360376            free(info);
    361377          else {
     378#           ifdef FORTIFY
     379            Fortify_SetOwner(info->path, 1);
     380            Fortify_SetScope(info->path, 1);
     381#           endif
    362382            info->next = NULL;
    363383            if (!udirhead)
     
    462482      info = xmalloc(sizeof(LINKDIRS), pszSrcFile, __LINE__);
    463483      if (info) {
     484#       ifdef FORTIFY
     485        Fortify_SetScope(info, 1);
     486#       endif
    464487        info->path = xstrdup(path, pszSrcFile, __LINE__);
    465488        if (!info->path)
    466489          free(info);
    467490        else {
     491#         ifdef FORTIFY
     492          Fortify_SetScope(info->path, 1);
     493#         endif
    468494          info->next = NULL;
    469495          if (userdirs) {
Note: See TracChangeset for help on using the changeset viewer.