Coverity analysis defect 102291: Wrong sizeof argument

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The sizeof operator is invoked on the wrong argument

      Defect 102291 (STATIC_C)
      Checker SIZEOF_MISMATCH (subcategory wrong_sizeof)
      File: /src/bson/bson-reader.c
      Function _bson_reader_data_read
      /src/bson/bson-reader.c, line: 574
      Passing argument "&reader->data[reader->offset]" of type "uint8_t const " and argument "4UL" ("sizeof (blen)") to function "memcpy" is suspicious because "sizeof (uint8_t const) /*1/" is expected.

                memcpy (&blen, &reader->data[reader->offset], sizeof blen);
      

            Assignee:
            A. Jesse Jiryu Davis
            Reporter:
            Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: