Changeset 1011


Ignore:
Timestamp:
May 11, 2008, 5:00:39 AM (17 years ago)
Author:
Gregg Young
Message:

Fortify updates to get it working everywhere

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/arccnrs.c

    r1009 r1011  
    8383#include "notebook.h"                   // CfgDlgProc
    8484#include "fm3dll.h"
     85#include "fortify.h"
    8586
    8687#pragma data_seg(DATA1)
  • trunk/dll/dircnrs.c

    r1009 r1011  
    33213321      dcd->stopflag++;
    33223322      if (!dcd->dontclose && ParentIsDesktop(dcd->hwndFrame, (HWND) 0))
    3323         PostMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID);
     3323        PostMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID);
    33243324      if (!dcd->hwndObject ||
    33253325          !PostMsg(dcd->hwndObject, WM_CLOSE, MPVOID, MPVOID)) {
  • trunk/dll/draglist.c

    r1009 r1011  
    3636#include "errutil.h"                    // Dos_Error...
    3737#include "fm3dll.h"
     38#include "fortify.h"
    3839
    3940static PSZ pszSrcFile = __FILE__;
  • trunk/dll/fm3dll.def

    r994 r1011  
    286286         RunFM2Util_                                  .268,
    287287         xDosFindFirst_                               .269,
    288          xDosFindNext_                                .270
    289 
     288         xDosFindNext_                                .270,
     289         xfree_                                       .271,
     290         xmalloc_                                     .272
     291
  • trunk/dll/grep.c

    r1009 r1011  
    5151#include "tmrsvcs.h"                    // ITIMER_DESC
    5252#include "fm3dll.h"
     53#include "fortify.h"
    5354
    5455#pragma data_seg(DATA2)
  • trunk/dll/mainwnd.c

    r1009 r1011  
    182182      WinEnableWindow(WinQueryWindow(hwndMain, QW_PARENT), TRUE);
    183183      fNoTileUpdate = FALSE;
    184       xfree((char *)mp1, pszSrcFile, __LINE__);
     184      //xfree((char *)mp1, pszSrcFile, __LINE__);
    185185      if (fAutoTile)
    186186        TileChildren(hwndMain, TRUE);
  • trunk/dll/ufortify.h

    r1005 r1011  
    1717#define FORTIFY_BEFORE_SIZE      32  /* Bytes to allocate before block */
    1818#define FORTIFY_BEFORE_VALUE   0xA3  /* Fill value before block        */
    19                      
     19
    2020#define FORTIFY_AFTER_SIZE       32  /* Bytes to allocate after block  */
    2121#define FORTIFY_AFTER_VALUE    0xA5  /* Fill value after block         */
     
    4747
    4848/* #define FORTIFY_NO_PERCENT_P */       /* sprintf() doesn't support %p */
    49 /* #define FORTIFY_STRDUP       */       /* if you use non-ANSI strdup() */
     49#define FORTIFY_STRDUP              /* if you use non-ANSI strdup() */
    5050
    5151// #include "_malloc.h"
  • trunk/dll/wrappers.c

    r1009 r1011  
    332332# ifdef FORTIFY
    333333    Fortify_free(pv, pszSrcFile, uiLineNumber);
    334 # else 
     334# else
    335335    free(pv);
    336336# endif
     
    345345# ifdef FORTIFY
    346346  PVOID pv = Fortify_malloc(cBytes, pszSrcFile, uiLineNumber);
    347 # else 
     347# else
    348348  PVOID pv = malloc(cBytes);
    349349# endif
     
    359359PVOID xmallocz(size_t cBytes, PCSZ pszSrcFile, UINT uiLineNumber)
    360360{
    361   PVOID pv = malloc(cBytes);
    362 
    363   if (!pv)
    364     Runtime_Error(pszSrcFile, uiLineNumber, GetPString(IDS_OUTOFMEMORY));
    365   else
     361  PVOID pv = xmalloc(cBytes, pszSrcFile, uiLineNumber);
     362
     363  if (pv)
    366364    memset(pv, 0, cBytes);
    367365
     
    374372{
    375373  if (pvIn != NullStr) {
    376     PVOID pv = realloc(pvIn, cBytes);
     374# ifdef FORTIFY
     375  PVOID pv = Fortify_realloc(pvIn, cBytes, pszSrcFile, uiLineNumber);
     376# else
     377  PVOID pv = realloc(pvIn, cBytes);
     378# endif
    377379
    378380    if (!pv && cBytes)
     
    391393# ifdef FORTIFY
    392394  PSZ psz = Fortify_strdup(pszIn, pszSrcFile, uiLineNumber);
    393 # else 
     395# else
    394396  PSZ psz = strdup(pszIn);
    395397# endif
  • trunk/eas.c

    r1010 r1011  
    2727#include "dll\fm3dll.h"
    2828
     29static PSZ pszSrcFile = __FILE__;
     30
    2931int main (int argc,char *argv[])
    3032{
     
    5254        if (!list) {
    5355          strcpy(fullname, "*");
    54           list = malloc(sizeof(CHAR *) * 2);
     56          list = xmalloc(sizeof(CHAR *) * 2, pszSrcFile, __LINE__);
    5557          if (list &&
    5658              insert_filename(HWND_DESKTOP,fullname,TRUE,FALSE) &&
    5759              *fullname && *fullname != '*') {
    58             list[0] = fullname;
    59             list[1] = NULL;
     60           list[0] = fullname;
     61           list[1] = NULL;
    6062          }
    6163        }
     
    7476  }
    7577  if (list)
    76     free(list);
     78    xfree(list, pszSrcFile, __LINE__);
    7779  return 0;
    7880}
Note: See TracChangeset for help on using the changeset viewer.