Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-1184

Segfault in bson_writer

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Critical - P2 Critical - P2
    • None
    • None
    • libbson
    • None
    • Ubuntu 15.10 AMD64bit

    Description

      The following code creates the segfault when a sufficiently sized json file is used:
      ...
      bwrit = bson_writer_new (&bbuf, &bblen, 0, bson_realloc_ctx, NULL);
      bson_writer_begin(bwrit, &udt);
      udt=bson_new_from_json((uint8_t*) jdat, -1, NULL);
      bson_writer_end(bwrit);

      The backtrace is as follows:

      memset (__len=5, __ch=0, __dest=0x1) at /usr/include/x86_64-linux-gnu/bits/string3.h:90
      bson_writer_begin (writer=writer@entry=0xe4b6b0, bson=bson@entry=0x7fffffffd480) at src/bson/bson-writer.c:205

      Attachments

        Activity

          People

            jesse@mongodb.com A. Jesse Jiryu Davis
            pichilds Paul Childs
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: