Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-3219 Review Coverity
  3. ACCUMULO-3220

Division by zero if encryption cipher isn't a block cipher

Log workAgile BoardRank to TopRank to BottomBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersConvert to IssueLinkCloneLabels
    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.6.0, 1.6.1
    • 1.6.2, 1.7.0
    • None

    Description

      BlockedOutputStream.java
        public BlockedOutputStream(OutputStream out, int blockSize, int bufferSize) {
          if (bufferSize <= 0)
            throw new IllegalArgumentException("bufferSize must be greater than 0.");
          if (out instanceof DataOutputStream)
            this.out = (DataOutputStream) out;
          else
            this.out = new DataOutputStream(out);
          this.blockSize = blockSize;
          int remainder = bufferSize % blockSize;
          if (remainder != 0)
            remainder = blockSize - remainder;
          // some buffer space + bytes to make the buffer evened up with the cipher block size - 4 bytes for the size int
          bb = ByteBuffer.allocate(bufferSize + remainder - 4);
        }
      

      If the Cipher is not a block cipher, blocksize is zero and would result in a division by zero error.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            elserj Josh Elser Assign to me
            elserj Josh Elser
            Votes:
            0 Vote for this issue
            Watchers:
            2 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

              Slack

                Issue deployment