summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--headers.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/headers.c b/headers.c
index d2c283c5..8267872d 100644
--- a/headers.c
+++ b/headers.c
@@ -284,6 +284,8 @@ GC_INNER GC_bool GC_install_counts(struct hblk *h, size_t sz/* bytes */)
for (hbp = h; (word)hbp < (word)h + sz; hbp += BOTTOM_SZ) {
if (!get_index((word) hbp)) return(FALSE);
+ if ((word)hbp > (~(word)0) - (word)BOTTOM_SZ * HBLKSIZE)
+ break; /* overflow */
}
if (!get_index((word)h + sz - 1)) return(FALSE);
for (hbp = h + 1; (word)hbp < (word)h + sz; hbp += 1) {