function CodedInputStream::pushLimit
1 call to CodedInputStream::pushLimit()
- CodedInputStream::incrementRecursionDepthAndPushLimit in vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ CodedInputStream.php
File
-
vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ CodedInputStream.php, line 302
Class
Namespace
Google\Protobuf\InternalCode
public function pushLimit($byte_limit) {
// Current position relative to the beginning of the stream.
$current_position = $this->current();
$old_limit = $this->current_limit;
// security: byte_limit is possibly evil, so check for negative values
// and overflow.
if ($byte_limit >= 0 && $byte_limit <= PHP_INT_MAX - $current_position && $byte_limit <= $this->current_limit - $current_position) {
$this->current_limit = $current_position + $byte_limit;
$this->recomputeBufferLimits();
}
else {
throw new GPBDecodeException("Fail to push limit.");
}
return $old_limit;
}