BCON_NEW segfault with 3 items in list

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 1.3.3
    • Component/s: libbson
    • Environment:
      RHEL7
    • None
    • None
    • None
    • None
    • None
    • None
    • None

          bson_t * query;
          query = BCON_NEW("$and","[",
                                       "{", "a", BCON_INT32(1), "}",
                                       "{", "b", "{", "$gte", BCON_INT32(1), "}", "}",
                                       "{", "b", "{", "$lt", BCON_INT32(3), "}", "}",
                                   "]");
          //prove it looks right
          size_t *s;
          const char * as_json;
          as_json = bson_as_json(query, s);
      

      crashes on bson_as_json call.

      Comment out any single one of the 3 documents in the and list and it works fine.

            Assignee:
            A. Jesse Jiryu Davis
            Reporter:
            Dan Bauman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: