diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-12-27 21:25:30 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-12-27 21:25:30 +0100 |
commit | 24027256aa9614a445563707a72af7ce5ff49b5b (patch) | |
tree | a47b937fcb4fab8b088ea8855ede04113fd3355a | |
parent | commit-reach: use `size_t` to track indices when computing merge bases (diff) | |
download | git-24027256aa9614a445563707a72af7ce5ff49b5b.tar.xz git-24027256aa9614a445563707a72af7ce5ff49b5b.zip |
sign-compare: avoid comparing ptrdiff with an int/unsigned
Instead, offset the base pointer with integer and compare it with
the other pointer.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | shallow.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -534,7 +534,7 @@ static uint32_t *paint_alloc(struct paint_info *info) unsigned nr = DIV_ROUND_UP(info->nr_bits, 32); unsigned size = nr * sizeof(uint32_t); void *p; - if (!info->pool_count || size > info->end - info->free) { + if (!info->pool_count || info->end < info->free + size) { if (size > POOL_SIZE) BUG("pool size too small for %d in paint_alloc()", size); |