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

CID 1248177: Dereference null return value (NULL_RETURNS)

    • Type: Icon: Task Task
    • Resolution: Done
    • WT2.4.1
    • Affects Version/s: None
    • Component/s: None

      Don, Coverity is complaining about this code, would you please take a look?

      *** CID 1248177:  Dereference null return value  (NULL_RETURNS)
      /src/utilities/util_load_json.c: 257 in json_data()
      251             recno = 0;
      252             while (json_peek(session, ins) == '{') {
      253                     nfield = 0;
      254                     JSON_EXPECT(session, ins, '{');
      255                     if ((ins)->kvraw == NULL)
      256                             (ins)->kvraw = (char *)malloc(1);
      >>>     CID 1248177:  Dereference null return value  (NULL_RETURNS)
      >>>     Dereferencing a null pointer "ins->kvraw".
      257                     (ins)->kvraw[0] = '\0';
      258                     (ins)->kvrawstart = JSON_INPUT_POS(ins);
      259                     keystrlen = 0;
      260                     while (json_peek(session, ins) == 's') {
      261                             JSON_EXPECT(session, ins, 's');
      262                             JSON_EXPECT(session, ins, ':');
      

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

              Created:
              Updated:
              Resolved: