VirtualBox

Changeset 1943 in kBuild


Ignore:
Timestamp:
Oct 26, 2008 2:19:06 AM (16 years ago)
Author:
bird
Message:

strcache2.c: fixed the length check.

File:
1 edited

Legend:

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

    r1940 r1943  
    10521052{
    10531053  struct strcache2_entry const *entry;
    1054   unsigned hash;
     1054  unsigned int hash;
     1055  unsigned int length;
    10551056  const char *end;
    10561057
     
    10641065    }
    10651066
    1066   end = memchr (str, '\0', entry->length);
    1067   if ((size_t)(end - str) == entry->length)
     1067  end = memchr (str, '\0', entry->length + 1);
     1068  length = end - str;
     1069  if (length != entry->length)
    10681070    {
    10691071      fprintf (stderr,
    1070                "strcache2[%s]: corrupt entry %p, length: %lu, expected %u;\nstring: %s\n",
    1071                cache->name, (void *)entry, (unsigned long)(end - str), entry->length, str);
     1072               "strcache2[%s]: corrupt entry %p, length: %u, expected %u;\nstring: %s\n",
     1073               cache->name, (void *)entry, length, entry->length, str);
    10721074      return -1;
    10731075    }
Note: See TracChangeset for help on using the changeset viewer.

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