Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-2482

Coverity 1353015, 1353016, out-of-bounds access

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • WT2.8.0
    • Affects Version/s: None
    • Component/s: None
    • None

      util_dump.c:

      391         */
         	3. Condition (char const *)uri[0] == (char const *)"table:"[0], taking true branch
         	4. Condition strncmp(uri, "table:", strlen("table:")) == 0, taking true branch
      392        if (WT_PREFIX_MATCH(uri, "table:")) {
         	5. strlen_assign: Setting variable len to a value computed using function strlen.
      393                len = strlen(uri) + strlen("colgroup:");
         	
      CID 1353016 (#1 of 1): Out-of-bounds access (OVERRUN)
      6. alloc_strlen: Allocating insufficient memory for the terminating null of the string.
         	7. Condition (p = malloc(len)) == NULL, taking false branch
      394                if ((p = malloc(len)) == NULL)
      395                        return (util_err(session, errno, NULL));
      
      495         */
      496        complex_table = false;
         	5. Condition (char const *)uri[0] == (char const *)"table:"[0], taking true branch
         	6. Condition strncmp(uri, "table:", strlen("table:")) == 0, taking true branch
      497        if (WT_PREFIX_MATCH(uri, "table:")) {
         	7. strlen_assign: Setting variable len to a value computed using function strlen.
      498                len = strlen(uri) + strlen("colgroup:");
         	
      CID 1353015 (#1 of 1): Out-of-bounds access (OVERRUN)
      8. alloc_strlen: Allocating insufficient memory for the terminating null of the string.
         	9. Condition (p = malloc(len)) == NULL, taking false branch
      499                if ((p = malloc(len)) == NULL)
      500                        return (util_err(session, errno, NULL));
      

            Assignee:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Reporter:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: