Changeset 931 for trunk/dll


Ignore:
Timestamp:
Jan 19, 2008, 8:15:26 PM (18 years ago)
Author:
Gregg Young
Message:

Fixed Trap caused by mismatch buffer sizes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/avv.c

    r927 r931  
    9393static PSZ free_and_strdup_quoted_from_window(HWND hwnd, USHORT id, PSZ pszDest)
    9494{ // fixme for command line limit
    95   CHAR szCmdLine[256];
    96   PSZ pszWorkBuf;
    97 
    98   pszWorkBuf = xmalloc(256, pszSrcFile, __LINE__);
     95  CHAR szCmdLine[MAXCOMLINESTRG];
     96
    9997  xfree(pszDest);
    10098  WinQueryDlgItemText(hwnd, id, sizeof(szCmdLine), szCmdLine);
    10199  if (*szCmdLine){
     100    PSZ pszWorkBuf;
     101    pszWorkBuf = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__);
    102102    NormalizeCmdLine(pszWorkBuf, szCmdLine);
    103     pszDest = xstrdup(pszWorkBuf, pszSrcFile, __LINE__);
     103    pszDest = xstrdup(szCmdLine, pszSrcFile, __LINE__);
     104    xfree(pszWorkBuf);
    104105  }
    105106  else
    106107    pszDest = NULL;
    107   xfree(pszWorkBuf);
    108108  return pszDest;
    109109}
Note: See TracChangeset for help on using the changeset viewer.