[asterisk-commits] func iconv: Ensure output strings are properly terminated. (asterisk[11])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 11 16:39:30 CST 2016


Joshua Colp has submitted this change and it was merged.

Change subject: func_iconv: Ensure output strings are properly terminated.
......................................................................


func_iconv: Ensure output strings are properly terminated.

ASTERISK-25272 #close
Reported by: Etienne Lessard
patches:
 AST-25272.patch submitted by Etienne Lessard (license #6394)

Change-Id: Id75ad202300960a1e91afe15e319d992936ecc17
---
M funcs/func_iconv.c
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Mark Michelson: Looks good to me, approved
  Joshua Colp: Looks good to me, but someone else must approve; Verified



diff --git a/funcs/func_iconv.c b/funcs/func_iconv.c
index c3d0286..0a8e57d 100644
--- a/funcs/func_iconv.c
+++ b/funcs/func_iconv.c
@@ -83,7 +83,7 @@
 		AST_APP_ARG(text);
 	);
 	iconv_t cd;
-	size_t incount, outcount = len;
+	size_t incount, outcount = len - 1;
 	char *parse;
 
 	if (ast_strlen_zero(arguments)) {
@@ -120,6 +120,7 @@
 		else
 			ast_log(LOG_WARNING,  "Iconv: error %d: %s.\n", errno, strerror(errno));
 	}
+	*buf = '\0';
 	iconv_close(cd);
 
 	return 0;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id75ad202300960a1e91afe15e319d992936ecc17
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-commits mailing list