Go Back   ZeroC Forums > Bug Reports

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 08-10-2007
blair blair is offline
Registered User
 
Name: Blair Zajac
Organization: Sony Pictures Imageworks
Project: VnP
 
Join Date: Mar 2007
Posts: 24
Cannot send strings with embedded \0

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:

Code:
    interface Test
    {
        idempotent string
        getString();
    };
Server side code:

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:

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
Reply With Quote
  #2 (permalink)  
Old 08-11-2007
Andreas Scherer Andreas Scherer is offline
Registered User
 
Name: Andreas Scherer
Organization: Private Linux Site
Project: Evaluating Ice-C++, Ice-Java, Ice-Python, Ice-Ruby
 
Join Date: Mar 2005
Location: Berlin, Germany
Posts: 47
Probably you are refering to the situation mentioned in section 4.8.3 of the Ice manual (page 91/109 of the 3.2.0 pdf):
Quote:
Slice strings use the Unicode character set. The only character that cannot appear inside a string is the zero character.
Take care,
Andreas
Reply With Quote
  #3 (permalink)  
Old 08-11-2007
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
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.
Reply With Quote
  #4 (permalink)  
Old 08-14-2007
blair blair is offline
Registered User
 
Name: Blair Zajac
Organization: Sony Pictures Imageworks
Project: VnP
 
Join Date: Mar 2007
Posts: 24
Thanks. It would be nice to get an exception on attempting to put a \0 into a string.

Regards,
Blair
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
IceSSL failure on Windows XP Embedded hpmike Bug Reports 2 07-30-2007 02:36 PM
Embedded Ice Banjo Help Center 1 07-22-2005 11:58 AM
win32/ question on passing and returning strings stephan Help Center 2 01-04-2004 03:49 PM
Method tokens: strings vs. indices JohnBates Comments 1 05-06-2003 08:44 PM


All times are GMT -4. The time now is 08:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.