framing: check for overflow on growing buffer
newsize is a long, but storage is an int. This means the allocation could succeed but storage would overflow.
newsize is a long, but storage is an int. This means the allocation could succeed but storage would overflow.