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

CID 1362785, CID 1362784: Error handling issues (CHECKED_RETURN in server push example

    Details

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

      Description

      *** CID 1362785:  Error handling issues  (CHECKED_RETURN)
      /example/server-push/server-push.c: 50 in should_push()
      44     
      45     bool
      46     should_push(TSHttpTxn txnp)
      47     {
      48       TSMBuffer mbuf;
      49       TSMLoc hdr, url;
         CID 1362785:  Error handling issues  (CHECKED_RETURN)
         Calling "TSHttpTxnClientReqGet" without checking return value (as is done elsewhere 45 out of 47 times).
      50       TSHttpTxnClientReqGet(txnp, &mbuf, &hdr);
      51       TSHttpHdrUrlGet(mbuf, hdr, &url);
      52       int len;
      53       TSUrlHttpQueryGet(mbuf, url, &len);
      54       TSHandleMLocRelease(mbuf, hdr, url);
      55       TSHandleMLocRelease(mbuf, TS_NULL_MLOC, hdr);
      
      ** CID 1362784:  Error handling issues  (CHECKED_RETURN)
      /example/server-push/server-push.c: 51 in should_push()
      
      
      ________________________________________________________________________________________________________
      *** CID 1362784:  Error handling issues  (CHECKED_RETURN)
      /example/server-push/server-push.c: 51 in should_push()
      45     bool
      46     should_push(TSHttpTxn txnp)
      47     {
      48       TSMBuffer mbuf;
      49       TSMLoc hdr, url;
      50       TSHttpTxnClientReqGet(txnp, &mbuf, &hdr);
         CID 1362784:  Error handling issues  (CHECKED_RETURN)
         Calling "TSHttpHdrUrlGet" without checking return value (as is done elsewhere 32 out of 36 times).
      51       TSHttpHdrUrlGet(mbuf, hdr, &url);
      52       int len;
      53       TSUrlHttpQueryGet(mbuf, url, &len);
      54       TSHandleMLocRelease(mbuf, hdr, url);
      55       TSHandleMLocRelease(mbuf, TS_NULL_MLOC, hdr);
      56       if (len > 0) {
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                masaori Masaori Koshiba
                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