- Timestamp:
- Sep 8, 2008, 7:27:38 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/dll/filldir.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/filldir.c
r1159 r1174 49 49 01 Sep 08 GKY Updated FreeCnrItemData to prevent trap in strrchr if pci->pszFileName is NULL. 50 50 05 Sep 08 SHL Correct FreeCnrItemData pszDisplayName pointer overlap check 51 08 Sep 08 SHL Remove extra pszLongName logic in FreeCnrItemData 51 52 52 53 ***********************************************************************/ … … 617 618 pfea = &eaop.fpFEA2List->list[0]; 618 619 value = pfea->szName + pfea->cbName + 1; // Point at EA value 619 value[pfea->cbValue] = 0; // Terminate620 value[pfea->cbValue] = 0; // Terminate 620 621 if (*(USHORT *) value == EAT_ASCII) { 621 p = value + sizeof(USHORT) * 2; // Point at value string622 p = value + sizeof(USHORT) * 2; // Point at value string 622 623 pci->pszLongName = xstrdup(p, pszSrcFile, __LINE__); 623 624 } … … 790 791 if (isalpha(*szDirBase) && szDirBase[1] == ':' && szDirBase[2] == '\\') { 791 792 if ((driveflags[toupper(*szDirBase) - 'A'] & DRIVE_REMOTE) && fRemoteBug) 792 ulFindMax = 1; // file system gets confused793 ulFindMax = 1; // file system gets confused 793 794 else if (driveflags[toupper(*szDirBase) - 'A'] & DRIVE_ZIPSTREAM) 794 795 ulFindMax = min(FilesToGet, 225); // anything more is wasted … … 1633 1634 if (pci->pszSubject && pci->pszSubject != NullStr) { 1634 1635 psz = pci->pszSubject; 1635 //pci->pszSubject = NullStr; 1636 pci->pszSubject = NULL; // for debug 1636 pci->pszSubject = NULL; // Catch illegal references 1637 1637 free(psz); 1638 1638 } 1639 1639 1640 // +1 in case long name pointing after last backslash 1641 if (pci->pszLongName && 1642 pci->pszLongName != NullStr && 1643 pci->pszLongName != pci->pszFileName && 1644 pci->pszLongName != pci->pszDisplayName && 1645 pci->pszLongName != pci->pszDisplayName + 1) { 1640 // 08 Sep 08 SHL Remove excess logic 1641 if (pci->pszLongName && pci->pszLongName != NullStr) { 1646 1642 psz = pci->pszLongName; 1647 //pci->pszLongName = NullStr; 1648 pci->pszLongName = NULL; // for debug 1643 pci->pszLongName = NULL; // Catch illegal references 1649 1644 free(psz); 1650 1645 } 1651 1652 // Check double free1653 if (!pci->pszFileName)1654 DbgMsg(pszSrcFile, __LINE__, "FreeCnrItemData pci->pszFileName already NULL");1655 1646 1656 1647 // Bypass free if pszDisplayName points into pszFileName buffer … … 1664 1655 { 1665 1656 psz = pci->pszDisplayName; 1666 // pci->pszDisplayName = NullStr; 1667 pci->pszDisplayName = NULL; // for debug 1657 pci->pszDisplayName = NULL; // Catch illegal references 1668 1658 free(psz); 1669 1659 } 1670 1660 } 1661 1662 // Catch extra calls to FreeCnrItemData 1663 if (!pci->pszFileName) 1664 DbgMsg(pszSrcFile, __LINE__, "FreeCnrItemData pci->pszFileName already NULL"); 1671 1665 1672 1666 if (pci->pszFileName && pci->pszFileName != NullStr) { 1673 1667 psz = pci->pszFileName; 1674 //pci->pszFileName = NullStr; 1675 pci->pszFileName = NULL; // for debug 1668 pci->pszFileName = NULL; // Catch illegal references 1676 1669 free(psz); 1677 1670 } … … 1679 1672 if (pci->pszFmtFileSize && pci->pszFmtFileSize != NullStr) { 1680 1673 psz = pci->pszFmtFileSize; 1681 //pci->pszFmtFileSize = NullStr; 1682 pci->pszFmtFileSize = NULL; // for debug 1674 pci->pszFmtFileSize = NULL; // Catch illegal references 1683 1675 free(psz); 1684 1676 } … … 1760 1752 while (pci) { 1761 1753 // 12 Sep 07 SHL dwg drivebar crash testing - ticket# ??? 1762 static PCNRITEM pciLast; // 12 Sep 07 SHL1754 static PCNRITEM pciLast; // 12 Sep 07 SHL 1763 1755 ULONG ulSize = sizeof(*pci); 1764 1756 ULONG ulAttr;
Note:
See TracChangeset
for help on using the changeset viewer.
