]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: null terminate armor result
authorYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 3 Dec 2010 23:20:45 +0000 (15:20 -0800)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Sat, 4 Dec 2010 03:34:37 +0000 (19:34 -0800)
src/rgw/rgw_admin.cc
src/rgw/rgw_main.cc

index f5d71e4726676ff2df3cc33e69cb5b85d0f2b8a3..ee5f811df436ed4ad13d81e5cfd9a39f6a21fbfa 100644 (file)
@@ -48,6 +48,7 @@ int gen_rand_base64(char *dest, int size) /* size should be the required string
     cerr << "ceph_armor failed" << std::endl;
     return -1;
   }
+  tmp_dest[ret] = '\0';
   memcpy(dest, tmp_dest, size);
   dest[size] = '\0';
 
index 1c57c6138815b1c1995b67f5a5412f9794b1f89f..5dddb6f9231c498e1c042248e9fb7da03fd39049 100644 (file)
@@ -205,6 +205,7 @@ static bool verify_signature(struct req_state *s)
     RGW_LOG(10) << "ceph_armor failed" << endl;
     return false;
   }
+  b64[ret] = '\0';
 
   RGW_LOG(15) << "b64=" << b64 << endl;
   RGW_LOG(15) << "auth_sign=" << auth_sign << endl;