]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix url escaping
authorYehuda Sadeh <yehuda@inktank.com>
Fri, 25 Apr 2014 21:11:27 +0000 (14:11 -0700)
committerSage Weil <sage@inktank.com>
Mon, 28 Apr 2014 21:15:10 +0000 (14:15 -0700)
Fixes: #8202
This fixes the radosgw side of issue #8202. Needed to cast value
to unsigned char, otherwise it'd get padded.

Backport: dumpling

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit bcf92c496aba0dfde432290fc2df5620a2767313)

src/rgw/rgw_common.cc

index e413a45095397ecbf4ae7b7fa036aad52c40c7c5..58913ccbaf0ddfbf9f4201f69490be0253ef2814 100644 (file)
@@ -731,7 +731,7 @@ bool url_decode(string& src_str, string& dest_str)
 static void escape_char(char c, string& dst)
 {
   char buf[16];
-  snprintf(buf, sizeof(buf), "%%%.2X", (unsigned int)c);
+  snprintf(buf, sizeof(buf), "%%%.2X", (int)(unsigned char)c);
   dst.append(buf);
 }