Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CodedInputStream.php

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

CodedInputStream

Namespace

Google\Protobuf\Internal

Code

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;
}
RSS feed
Powered by Drupal