From a0271000c12486d3c5adb2b0732e1c70c3789a4f Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Fri, 25 Apr 2014 14:11:27 -0700 Subject: [PATCH] rgw: fix url escaping 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 (cherry picked from commit bcf92c496aba0dfde432290fc2df5620a2767313) --- src/rgw/rgw_common.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc index e413a45095397..58913ccbaf0dd 100644 --- a/src/rgw/rgw_common.cc +++ b/src/rgw/rgw_common.cc @@ -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); } -- 2.39.5