Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-49115

Data corruption when receiving payload over 1024 bytes

XMLWordPrintable

      There is a bug in the loop that reads the incoming data with a 1024 byte buffer. The full content of the buffer is always appended to the output string, even when fewer than 1024 characters were read. As a result, when the incoming data is longer than 1024 bytes, some extra bytes are appended at the end of the output from the last full buffer read operation. This doesn't impact payloads smaller than 1024 bytes as the buffer is allegedly initialised with 0.

      Here's a small fix for this bug, by setting the limit of the buffer to the number of bytes read before appending its content to the output:
      https://github.com/jenkinsci/webhook-step-plugin/pull/6

            cpitman Chris Pitman
            gtucker Guillaume Tucker
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: