Description
The totalLength field in org.apache.cxf.io.CachedOutputStream is declared as a int field, so when a file greater than 2GB is uploaded for a PUT operation, OOM is thrown.
When the file size is over 2GB the condition 'totalLength < limit' becomes true when it should not.
public void writeCacheTo(StringBuilder out, String charsetName, int limit) throws IOException {
294 flush();
295 if (totalLength < limit
296 || limit == -1)