X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=chiark-tcl.git;a=blobdiff_plain;f=hbytes%2Fhbytes.c;h=15980dcd6024e7518c8f60a7c1ba72bfb295f3d3;hp=5daecd1c5038437357fb896f1bd9d4e4b9044005;hb=ceed4cf646a34245b3bc88089a2187ebf7a41f0f;hpb=73cb29760348de6e329efdab662b8a320c92b136 diff --git a/hbytes/hbytes.c b/hbytes/hbytes.c index 5daecd1..15980dc 100644 --- a/hbytes/hbytes.c +++ b/hbytes/hbytes.c @@ -98,6 +98,8 @@ Byte *cht_hb_prepend(HBytes_Value *hb, int el) { Byte *old_block, *new_block, *new_dstart; cx= complex(hb); + + assert(el < INT_MAX/4 && cx->len < INT_MAX/2); if (cx->prespace < el) { new_prespace= el*2 + cx->len; @@ -121,6 +123,7 @@ Byte *cht_hb_append(HBytes_Value *hb, int el) { Byte *newpart, *new_block, *old_block; cx= complex(hb); + assert(el < INT_MAX/4 && cx->len < INT_MAX/4); new_len= cx->len + el; if (new_len > cx->avail) {