summaryrefslogtreecommitdiff
path: root/ext/curl/interface.c
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2014-09-28 17:53:49 -0700
committerStanislav Malyshev <stas@php.net>2014-10-14 10:43:59 -0700
commitd1e030db02f402efebfe2976482dd7e7ebe2956f (patch)
treea9061fe638efd2cb4f689e3102f759c1c9ab4a20 /ext/curl/interface.c
parent9aa90145239bae82d2af0a99fdae4ab27eb5f4f2 (diff)
downloadphp-git-d1e030db02f402efebfe2976482dd7e7ebe2956f.tar.gz
Fix bug #68089 - do not accept options with embedded \0
Conflicts: ext/curl/interface.c
Diffstat (limited to 'ext/curl/interface.c')
-rw-r--r--ext/curl/interface.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 765918cc35..eab2edf663 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -169,6 +169,11 @@ static int php_curl_option_str(php_curl *ch, long option, const char *str, const
{
CURLcode error = CURLE_OK;
+ if (strlen(str) != len) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Curl option contains invalid characters (\\0)");
+ return 0;
+ }
+
#if LIBCURL_VERSION_NUM >= 0x071100
if (make_copy) {
#endif