VirtualBox

Changeset 1484 in kBuild


Ignore:
Timestamp:
Apr 3, 2008 10:04:54 PM (17 years ago)
Author:
bird
Message:

Fixed memchr crash in kbuild_get_object_base. A recent regression caused by the '..' -> 'dt' change.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/kbuild.c

    r1397 r1484  
    940940
    941941    /* convert '..' path elements in the source to 'dt'. */
    942     psz = pszDot;
    943     while ((psz = memchr(psz, '.', cchSrc + 1 - (pszDot - psz))) != NULL)
    944     {
    945         if (    psz[1] == '.'
    946             &&  (   psz == pszDot
    947                  || psz[-1] == '/'
     942    while ((pszDot = memchr(pszDot, '.', psz - pszDot)) != NULL)
     943    {
     944        if (    pszDot[1] == '.'
     945            &&  (   pszDot == psz
     946                 || pszDot[-1] == '/'
    948947#ifdef HAVE_DOS_PATHS
    949                  || psz[-1] == '\\'
    950                  || psz[-1] == ':'
     948                 || pszDot[-1] == '\\'
     949                 || pszDot[-1] == ':'
    951950#endif
    952951                )
    953             &&  (   !psz[2]
    954                  || psz[2] == '/'
     952            &&  (   !pszDot[2]
     953                 || pszDot[2] == '/'
    955954#ifdef HAVE_DOS_PATHS
    956                  || psz[2] == '\\'
    957                  || psz[2] == ':'
     955                 || pszDot[2] == '\\'
     956                 || pszDot[2] == ':'
    958957#endif
    959958                )
    960959            )
    961960        {
    962             *psz++ = 'd';
    963             *psz++ = 't';
     961            *pszDot++ = 'd';
     962            *pszDot++ = 't';
    964963        }
    965964        else
    966             psz++;
     965            pszDot++;
    967966    }
    968967
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette