Imported Upstream version 1.15.1
[platform/upstream/krb5.git] / src / plugins / kdb / db2 / libdb2 / btree / bt_put.c
index f75ca92..7d65928 100644 (file)
@@ -208,7 +208,8 @@ delete:             if (__bt_dleaf(t, key, h, idx) == RET_ERROR) {
         * into the offset array, shift the pointers up.
         */
        nbytes = NBLEAFDBT(key->size, data->size);
-       if (h->upper - h->lower < nbytes + sizeof(indx_t)) {
+       if ((u_int32_t)h->upper - (u_int32_t)h->lower
+           < nbytes + sizeof(indx_t)) {
                if ((status = __bt_split(t, h, key,
                    data, dflags, nbytes, idx)) != RET_SUCCESS)
                        return (status);
@@ -292,7 +293,7 @@ bt_fast(t, key, data, exactp)
         * have to search to get split stack.
         */
        nbytes = NBLEAFDBT(key->size, data->size);
-       if (h->upper - h->lower < nbytes + sizeof(indx_t))
+       if ((u_int32_t)h->upper - (u_int32_t)h->lower < nbytes + sizeof(indx_t))
                goto miss;
 
        if (t->bt_order == FORWARD) {