Archived
This forum has been archived. Please start a new discussion on GitHub.
Cannot send strings with embedded \0
blair
in Bug Reports
I accidentally got a \0 into a Java string used as an exception error message sent to the client and the any part of the string after the \0 does not appear on the client.
Using IcePy 3.2.0 for the client and server, you can reproduce this pretty easily:
Server side code:
Client side code:
I get the string 'hello '. If you change the chr(0) to a chr(1) then it works.
I was able to get the chr(0) into the Java server in the first place by passing from Python code to the Java server a string with a \0 in it.
Regards,
Blair
Using IcePy 3.2.0 for the client and server, you can reproduce this pretty easily:
interface Test
{
idempotent string
getString();
};
Server side code:
class TestI(Test):
def getString(self, current=None):
s = 'hello '
for i in range(3):
s += chr(0)
s += ' there'
return s
Client side code:
s = self.VnpClock.getString()
print repr(s)
I get the string 'hello '. If you change the chr(0) to a chr(1) then it works.
I was able to get the chr(0) into the Java server in the first place by passing from Python code to the Java server a string with a \0 in it.
Regards,
Blair
0
Comments
-
Andreas is correct, 0 is not allowed in Slice strings. See this footnote. However, it is a bug that Ice does not raise an exception. Thanks for reporting this, we will investigate and fix this.0
