Description of problem: The 0.10 codecs (both C++ and python) will allow the encoding of a string data type with a length that is greater than 64K. The 0.10 codec only defines string encodings that allow for strings up to 64K in length (length is encoded as a 16-bit unsigned integer). Version-Release number of selected component (if applicable): beta How reproducible: 100% Steps to Reproduce: 1. Send a message containing a string of length > 65535 bytes long. Actual results: Varies by implementation - C++ appears to convert the string to a vbin type. Python appears to corrupt the encoded length value. Expected results: 0.10 does not support strings > 65535 bytes in length - attempting to send message containing such a string should fail and notify the calling application (e.g. throw an exception). Additional info:
Created attachment 451681 [details] A V2-based agent that provides a string echo method. Can be used to reproduce the string encoding error. Run the agent like this: ./run_nozzle -b host:port -n 1 -t 10 -q A client can then query the agent for a data object _class="data", and invoke the echo method on the data object. The method takes a string argument. Attempting to invoke the method with a string with length > 65K will result in a timeout error. It should fail immediately with an error indicating the string is too long. Example client code: #!/usr/bin/python # $ ./big-echo.py mrg2.lab.bos.redhat.com 20 from qmf.console import * import sys url, size = sys.argv[1:3] size = int(size) s = Session() b = s.addBroker(url) a = b.getAgents()[1] d = a.getObjects(_class="data")[0] d.echo(1, "x" * size) s.delBroker(b)
Created attachment 455973 [details] Proposed fix. Proposed patch: will throw an exception if an attempt is to encode a value that cannot be represented by the target type.
Comment on attachment 455973 [details] Proposed fix. Seems reasonable fix to me.
Upstream JIRA: https://issues.apache.org/jira/browse/QPID-2916
Upstream fix: http://svn.apache.org/viewvc?view=revision&revision=1028501 http://svn.apache.org/viewvc?view=revision&revision=1028812
This bug now covers only the python component of the fix. Bug 667735 covers the c++ component.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Cause QPID clients that send a message containing a string which is greater than 65535 bytes in length. Consequence The client silently truncates the string to 65535 bytes in length, which corrupts the contained data. Fix QPID does not support strings greater than 65535 bytes in length. The encoding code now checks the length of all strings sent by clients, and enforces this length limit. Result Should a client attempt to send a string with a length greater than 65535 bytes, an exception shall be thrown.
The issue has been fixed Verified on RHEL4.8 and RHEL5.6, architectures: i386, x86_64 packages installed: python-qpid-0.7.946106-15 VERIFIED
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-0217.html