Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-4871

CID 1362796: Integer handling issues (NEGATIVE_RETURNS) in statistics plugin

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.0.0
    • Component/s: Plugins
    • Labels:

      Description

      *** CID 1362796:  Integer handling issues  (NEGATIVE_RETURNS)
      /example/statistic/statistic.cc: 50 in TSPluginInit()
      44     
      45       int id;
      46       const char name[] = "example.statistic.now";
      47     
      48       if (TSStatFindName(name, &id) == TS_ERROR) {
      49         id = TSStatCreate(name, TS_RECORDDATATYPE_INT, TS_STAT_NON_PERSISTENT, TS_STAT_SYNC_SUM);
         CID 1362796:  Integer handling issues  (NEGATIVE_RETURNS)
         Variable "id" tests negative.
      50         if (id == TS_ERROR) {
      51           TSError("%s: failed to register '%s'", PLUGIN_NAME, name);
      52         }
      53       }
      54     
      55       TSError("%s: %s registered with id %d", PLUGIN_NAME, name, id);
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jamespeach James Peach
                Reporter:
                zwoop Leif Hedstrom
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m