[asterisk-commits] func curl: Don't trim response text on non-ASCII characters (asterisk[11])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon May 23 09:27:33 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: func_curl: Don't trim response text on non-ASCII characters
......................................................................


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
---
M include/asterisk/strings.h
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Anonymous Coward #1000019: Verified
  Matt Jordan: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved



diff --git a/include/asterisk/strings.h b/include/asterisk/strings.h
index aae26ab..00f83b5 100644
--- a/include/asterisk/strings.h
+++ b/include/asterisk/strings.h
@@ -469,7 +469,7 @@
 	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';
 	}
 }

-- 
To view, visit https://gerrit.asterisk.org/2893
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia51e169f24e3252a7ebbaab3728630138ec6f60a
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Ivan Poddubny <ivan.poddubny at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-commits mailing list