]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/rados: correctly return data with NULLs
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 25 May 2011 22:48:31 +0000 (15:48 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 25 May 2011 22:48:31 +0000 (15:48 -0700)
Correctly handle returning data with embedded NULLs in it.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/pybind/rados.py

index 43582c5d1497a3c8ce57efa27ccd4b8efa20f988..b4d663aab91cbc3294797e55a1bd89ea6be5bc81 100755 (executable)
@@ -383,7 +383,7 @@ written." % (self.name, ret, length))
                 c_size_t(length), c_uint64(offset))
         if ret < 0:
             raise make_ex("Ioctx.read(%s): failed to read %s" % (self.name, key))
-        return ret_buf.value
+        return ctypes.string_at(ret_buf, ret)
 
     def get_stats(self):
         self.require_ioctx_open()