[asterisk-commits] tilghman: branch 1.6.2 r294988 - /branches/1.6.2/funcs/func_curl.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Nov 15 01:42:46 CST 2010
Author: tilghman
Date: Mon Nov 15 01:42:39 2010
New Revision: 294988
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=294988
Log:
It is possible to crash Asterisk by feeding the curl config engine invalid data.
(closes issue #18161)
Reported by: wdoekes
Patches:
20101029__issue18161.diff.txt uploaded by tilghman (license 14)
Tested by: tilghman
Modified:
branches/1.6.2/funcs/func_curl.c
Modified: branches/1.6.2/funcs/func_curl.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/funcs/func_curl.c?view=diff&rev=294988&r1=294987&r2=294988
==============================================================================
--- branches/1.6.2/funcs/func_curl.c (original)
+++ branches/1.6.2/funcs/func_curl.c Mon Nov 15 01:42:39 2010
@@ -477,8 +477,11 @@
struct ast_str *fields = ast_str_create(ast_str_strlen(str) / 2);
struct ast_str *values = ast_str_create(ast_str_strlen(str) / 2);
int rowcount = 0;
- while ((piece = strsep(&remainder, "&"))) {
+ while (fields && values && (piece = strsep(&remainder, "&"))) {
char *name = strsep(&piece, "=");
+ if (!piece) {
+ piece = "";
+ }
ast_uri_decode(piece);
ast_uri_decode(name);
ast_str_append(&fields, 0, "%s%s", rowcount ? "," : "", name);
More information about the asterisk-commits
mailing list