Uploaded image for project: 'Couchbase PHP client library'
  1. Couchbase PHP client library
  2. PCBC-688

Segfault in ViewOptions when using raw

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.0.3
    • 3.0.2
    • None
    • None
    • PHP 7.3 and 7.4
    • 1

    Description

      I can generate a segfault when using the following code:

      <?php
      $o = new \Couchbase\ViewOptions();
      $id = 1;
      $o->raw('startkey', '[' . $id . ']');
      var_dump($o);

      Running the code with either php 7.3 or 7.4 yields the following output:

      object(Couchbase\ViewOptions)#1 (5) {
      ["timeout":"Couchbase\ViewOptions":private]=>
      NULL
      ["include_docs":"Couchbase\ViewOptions":private]=>
      NULL
      ["max_concurrent_docs":"Couchbase\ViewOptions":private]=>
      NULL
      ["query":"Couchbase\ViewOptions":private]=>
      array(1) {
      ["startkey"]=>
      string(4047968968097231973) "Segmentation fault (core dumped)

      This doesn't happen when I give '[1]' instead of '[' . $id . ']' for some reason to the raw function.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            avsej Sergey Avseyev
            demontpx Bert Hekman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty