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

Commit 25f0d7ba authored by James Dong's avatar James Dong
Browse files

Should really compare the pos to the total number of values in get() and set()...

Should really compare the pos to the total number of values in get() and set() methods in ListTableEntries class

o related-to-bug: 6435176

Change-Id: Ib6f6e598304e7c9becfa6cb3fc925c55b2df2682
parent c620cbd7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ private:
        // @arg value must be in network byte order
        // @arg pos location the value must be in.
        void set(const TYPE& value, uint32_t pos) {
            CHECK_LT(pos, mTotalNumTableEntries);
            CHECK_LT(pos, mTotalNumTableEntries * mEntryCapacity);

            typename List<TYPE *>::iterator it = mTableEntryList.begin();
            uint32_t iterations = (pos / (mElementCapacity * mEntryCapacity));
@@ -122,7 +122,7 @@ private:
        // @arg pos location the value must be in.
        // @return true if a value is found.
        bool get(TYPE& value, uint32_t pos) const {
            if (pos >= mTotalNumTableEntries) {
            if (pos >= mTotalNumTableEntries * mEntryCapacity) {
                return false;
            }