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

Coverity analysis defect 112395: Untrusted value as argument

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      An unscrutinized value from an untrusted source used as argument to a function (for example, a buffer size)

      Defect 112395 (STATIC_C)
      Checker TAINTED_SCALAR (subcategory critical_argument)
      File: /src/tools/mongoc-stat.c
      Function mongoc_counters_new_from_pid
      /src/tools/mongoc-stat.c, line: 103
      Calling function "pread" taints argument "len".

             if (4 != pread (fd, &len, 4, 0)) {
      

      /src/tools/mongoc-stat.c, line: 113
      Assigning: "size" = "len". Both are now tainted.

             size = len;
      

      /src/tools/mongoc-stat.c, line: 115
      Passing tainted variable "size" to a tainted sink.

             if (MAP_FAILED == (mem = mmap (NULL, size, PROT_READ, MAP_SHARED, fd, 0))) {
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: