Skip to content

Commit

Permalink
QUIC UINT_SET: Fix regression after list refactor
Browse files Browse the repository at this point in the history
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from #21565)
  • Loading branch information
hlandau committed Aug 10, 2023
1 parent ec2b45f commit dc5e5c5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ssl/quic/uint_set.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ int ossl_uint_set_remove(UINT_SET *s, const UINT_RANGE *range)
*/
ossl_list_uint_set_remove(s, z);
OPENSSL_free(z);
} else if (start <= z->range.start) {
} else if (start <= z->range.start && end >= z->range.start) {
/*
* The range being removed includes start of this range, but does
* not cover the entire range (as this would be caught by the case
Expand All @@ -303,14 +303,15 @@ int ossl_uint_set_remove(UINT_SET *s, const UINT_RANGE *range)
*/
y = create_set_item(end + 1, z->range.end);
ossl_list_uint_set_insert_after(s, z, y);
z->range.end = start - 1;
break;
} else {
/* Assert no partial overlap; all cases should be covered above. */
assert(!uint_range_overlaps(&z->range, range));
}
}

return 1;
return 1;
}

int ossl_uint_set_query(const UINT_SET *s, uint64_t v)
Expand Down

0 comments on commit dc5e5c5

Please sign in to comment.