Index: res/res_config_curl.c =================================================================== --- res/res_config_curl.c (revision 279917) +++ res/res_config_curl.c (working copy) @@ -88,7 +88,7 @@ va_end(ap); ast_str_append(&query, 0, ")}"); - pbx_substitute_variables_helper(NULL, ast_str_buffer(query), buffer, bufsize); + pbx_substitute_variables_helper(NULL, ast_str_buffer(query), buffer, bufsize - 1); /* Remove any trailing newline characters */ if ((stringp = strchr(buffer, '\r')) || (stringp = strchr(buffer, '\n'))) @@ -170,7 +170,7 @@ ast_str_append(&query, 0, ")}"); /* Do the CURL query */ - pbx_substitute_variables_helper(NULL, ast_str_buffer(query), buffer, bufsize); + pbx_substitute_variables_helper(NULL, ast_str_buffer(query), buffer, bufsize - 1); if (!(cfg = ast_config_new())) goto exit_multi; @@ -258,7 +258,7 @@ va_end(ap); ast_str_append(&query, 0, ")}"); - pbx_substitute_variables_helper(NULL, ast_str_buffer(query), buffer, bufsize); + pbx_substitute_variables_helper(NULL, ast_str_buffer(query), buffer, bufsize - 1); /* Line oriented output */ stringp = buffer; @@ -321,7 +321,7 @@ ast_str_append(&query, 0, ")}"); /* TODO: Make proxies work */ - pbx_substitute_variables_helper(NULL, ast_str_buffer(query), buffer, bufsize); + pbx_substitute_variables_helper(NULL, ast_str_buffer(query), buffer, bufsize - 1); /* Line oriented output */ stringp = buffer; @@ -385,7 +385,7 @@ va_end(ap); ast_str_append(&query, 0, ")}"); - pbx_substitute_variables_helper(NULL, ast_str_buffer(query), buffer, bufsize); + pbx_substitute_variables_helper(NULL, ast_str_buffer(query), buffer, bufsize - 1); stringp = buffer; while (*stringp <= ' ') @@ -452,7 +452,7 @@ va_end(ap); ast_str_append(&query, 0, ")}"); - pbx_substitute_variables_helper(NULL, ast_str_buffer(query), buffer, bufsize); + pbx_substitute_variables_helper(NULL, ast_str_buffer(query), buffer, bufsize - 1); /* Line oriented output */ stringp = buffer; @@ -511,7 +511,7 @@ va_end(ap); ast_str_append(&query, 0, ")}"); - pbx_substitute_variables_helper(NULL, ast_str_buffer(query), buffer, sizeof(buffer)); + pbx_substitute_variables_helper(NULL, ast_str_buffer(query), buffer, sizeof(buffer) - 1); return atoi(buffer); } @@ -544,7 +544,7 @@ ast_str_set(&query, 0, "${CURL(%s/static?file=%s)}", url, buf1); /* Do the CURL query */ - pbx_substitute_variables_helper(NULL, ast_str_buffer(query), buffer, bufsize); + pbx_substitute_variables_helper(NULL, ast_str_buffer(query), buffer, bufsize - 1); /* Line oriented output */ stringp = buffer;