rgw: off-by-one in rgw_trim_whitespace()

Fixes: #7543
Backport: dumpling

Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
Signed-off-by: Ray Lv <raylv@yahoo-inc.com>
This commit is contained in:
Ray Lv 2014-02-26 21:17:32 +08:00 committed by Yehuda Sadeh
parent ffdfb846a2
commit 195d53a7fc

View File

@ -793,7 +793,7 @@ string rgw_trim_whitespace(const string& src)
}
int end = src.size() - 1;
if (end <= start) {
if (end < start) {
return string();
}