From: Ivan Poddubny Date: Sat, 21 May 2016 10:42:45 +0000 (+0300) Subject: func_curl: Don't trim response text on non-ASCII characters X-Git-Tag: 11.23.0-rc1~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e44c8071583117605c6f207cb78b2c93424e829;p=thirdparty%2Fasterisk.git func_curl: Don't trim response text on non-ASCII characters The characters 0x80-0xFF were trimmed as well as 0x00-0x20 because of a signed comparison. ASTERISK-25669 #close Reported by: Jesper patches: strings.curl.trim.patch submitted by Jesper (License 5518) Change-Id: Ia51e169f24e3252a7ebbaab3728630138ec6f60a --- diff --git a/include/asterisk/strings.h b/include/asterisk/strings.h index aae26ab494..00f83b500b 100644 --- a/include/asterisk/strings.h +++ b/include/asterisk/strings.h @@ -469,7 +469,7 @@ void ast_str_trim_blanks(struct ast_str *buf), if (!buf) { return; } - while (buf->__AST_STR_USED && buf->__AST_STR_STR[buf->__AST_STR_USED - 1] < 33) { + while (buf->__AST_STR_USED && ((unsigned char) buf->__AST_STR_STR[buf->__AST_STR_USED - 1]) < 33) { buf->__AST_STR_STR[--(buf->__AST_STR_USED)] = '\0'; } }