-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Critical
-
Component/s: webhook-step-plugin
-
None
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