]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ebofs: cope with zero-length attribute values
authorSage Weil <sage@newdream.net>
Mon, 10 Nov 2008 21:40:50 +0000 (13:40 -0800)
committerSage Weil <sage@newdream.net>
Mon, 10 Nov 2008 21:40:50 +0000 (13:40 -0800)
src/ebofs/Ebofs.cc

index 37e5d9007ea4205b9fa0e7b2bae43e19b2b0232b..01d5f93d4e32a2fff7b9e82dbb618b776b496f71 100644 (file)
@@ -838,7 +838,8 @@ csum_t Ebofs::encode_onode(Onode *on, bufferlist& bl, unsigned& off)
     int l = i->second.length();
     bl.copy_in(off, sizeof(int), (char*)&l);
     off += sizeof(int);
-    bl.copy_in(off, l, i->second.c_str());
+    if (l)
+      bl.copy_in(off, l, i->second.c_str());
     off += l;
     dout(15) << "encode_onode " << *on  << " attr " << i->first << " len " << l << dendl;
   }