chiark
/
gitweb
/
~ian
/
chiark-tcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
use of int and overflow review
[chiark-tcl.git]
/
hbytes
/
hook.c
diff --git
a/hbytes/hook.c
b/hbytes/hook.c
index b49aaa1a8b9414c5de31a2193e2a23bc950e4d08..b2d4dc4e1abc657da57497315d8999b1795a2363 100644
(file)
--- a/
hbytes/hook.c
+++ b/
hbytes/hook.c
@@
-73,6
+73,7
@@
void cht_obj_updatestr_array_prefix(Tcl_Obj *o, const Byte *byte,
int pl;
pl= strlen(prefix);
+ assert(l < INT_MAX/2 - 1 - pl);
o->length= l*2+pl;
str= o->bytes= TALLOC(o->length+1);