Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-17376

Coverity: Bad pointer to function comparison

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: 7.0.0
    • Component/s: Core Libraries
    • Labels:
      None
    • Compatibility:
      Minor

      Description

      *** CID 1427836:  Incorrect expression  (BAD_COMPARE)
      /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/system/security/zcrypt/zcrypt.cpp: 1060 in zlib_deflate(MemoryBuffer &, const char *, unsigned int, int, ZlibCompressionType)()
      1054
      1055     // Compress a character buffer using zlib in gzip/zlib_deflate format with given compression level
      1056     //
      1057     void zlib_deflate(MemoryBuffer &mb, const char* inputBuffer, unsigned int inputSize, int compressionLevel, ZlibCompressionType zltype)
      1058     {
      1059         if (inputBuffer == NULL || inputSize == 0)
      >>>     CID 1427836:  Incorrect expression  (BAD_COMPARE)
      >>>     This implicit conversion to a function pointer is suspicious: "gzip".
      1060             throw MakeStringException(500, "%s failed: input buffer is empty!", gzip ? "gzip" : "zlib_deflate");
      

      The test for gzip ? ... should be checking zltype instead

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                richardkchapman Richard Chapman
                Reporter:
                ghalliday Gavin Halliday
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: