Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4b3d8bd9 authored by Kenny Root's avatar Kenny Root Committed by Android Git Automerger
Browse files

am 7ba8c44e: am 8ad30b5b: Merge "Initialized check in ZipFileRO::findEntryByName" into gingerbread

Merge commit '7ba8c44ef7ba22d83a670e50314d69d0ddce1b9c'

* commit '7ba8c44ef7ba22d83a670e50314d69d0ddce1b9c':
  Initialized check in ZipFileRO::findEntryByName
parents 21a91015 9f46e87d
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -412,10 +412,18 @@ void ZipFileRO::addToHash(const char* str, int strLen, unsigned int hash)
/*
 * Find a matching entry.
 *
 * Returns 0 if not found.
 * Returns NULL if not found.
 */
ZipEntryRO ZipFileRO::findEntryByName(const char* fileName) const
{
    /*
     * If the ZipFileRO instance is not initialized, the entry number will
     * end up being garbage since mHashTableSize is -1.
     */
    if (mHashTableSize <= 0) {
        return NULL;
    }

    int nameLen = strlen(fileName);
    unsigned int hash = computeHash(fileName, nameLen);
    int ent = hash & (mHashTableSize-1);