diff --git a/CMakeLists.txt b/CMakeLists.txt
index f5c3683bb..c8e284480 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
 
 project(libtorrent
 	DESCRIPTION "Bittorrent library"
-	VERSION 1.1.13
+	VERSION 1.1.14
 )
 
 set (SOVERSION "9")
diff --git a/ChangeLog b/ChangeLog
index 181e1a939..6c74a8067 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+1.1.14 release
+
+	* add handling on invalid piece index to torrent_handle::have_piece()
+	* fix error in treatment of move_storage() flags
+	* fix division by zero in anti-leech choker
+	* fix chunked http header validation
+	* fix use-after-free in SSL shutdown
+	* fix possible leak entry when assigning from bdecode_node or lazy_entry
+	* fix error handling of moving storage to a drive letter that isn't mounted
+	* fix bug in python binding parsing file_priorities from add_torrent_params
+	* fix target hostname in http connections using http proxy
+
 1.1.13 release
 
 	* fix sock_type_t python binding
diff --git a/Jamfile b/Jamfile
index 319aea7ee..f67d7c378 100644
--- a/Jamfile
+++ b/Jamfile
@@ -57,7 +57,7 @@ else
 		: : $(boost-include-path) ;
 }
 
-VERSION = 1.1.13 ;
+VERSION = 1.1.14 ;
 
 rule linking ( properties * )
 {
diff --git a/bindings/python/setup.py b/bindings/python/setup.py
index d4096d3ce..51d280bed 100644
--- a/bindings/python/setup.py
+++ b/bindings/python/setup.py
@@ -154,7 +154,7 @@ else:
 			libraries = ['torrent-rasterbar'] + flags.libraries)]
 
 setup(name = 'python-libtorrent',
-	version = '1.1.13',
+	version = '1.1.14',
 	author = 'Arvid Norberg',
 	author_email = 'arvid@libtorrent.org',
 	description = 'Python bindings for libtorrent-rasterbar',
diff --git a/bindings/python/src/session.cpp b/bindings/python/src/session.cpp
index 283b53155..d89988a2f 100644
--- a/bindings/python/src/session.cpp
+++ b/bindings/python/src/session.cpp
@@ -322,9 +322,9 @@ namespace
         {
             list l = extract<list>(params["file_priorities"]);
             int n = boost::python::len(l);
+            p.file_priorities.clear();
             for(int i = 0; i < n; i++)
                 p.file_priorities.push_back(extract<boost::uint8_t>(l[i]));
-            p.file_priorities.clear();
         }
     }
 
diff --git a/configure.ac b/configure.ac
index 9421fbad7..8a243c130 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,7 +5,7 @@
 
 AC_PREREQ([2.63])
 
-AC_INIT([libtorrent-rasterbar],[1.1.13],[arvid@libtorrent.org],
+AC_INIT([libtorrent-rasterbar],[1.1.14],[arvid@libtorrent.org],
         [libtorrent-rasterbar],[http://www.libtorrent.org])
 AC_CONFIG_SRCDIR([src/torrent.cpp])
 AC_CONFIG_AUX_DIR([build-aux])
diff --git a/docs/building.rst b/docs/building.rst
index 57fc64630..8a5556ca3 100644
--- a/docs/building.rst
+++ b/docs/building.rst
@@ -3,7 +3,7 @@ libtorrent manual
 =================
 
 :Author: Arvid Norberg, arvid@libtorrent.org
-:Version: 1.1.13
+:Version: 1.1.14
 
 .. contents:: Table of contents
   :depth: 2
diff --git a/docs/contributing.rst b/docs/contributing.rst
index f8d142644..924d3406e 100644
--- a/docs/contributing.rst
+++ b/docs/contributing.rst
@@ -3,7 +3,7 @@ libtorrent manual
 =================
 
 :Author: Arvid Norberg, arvid@libtorrent.org
-:Version: 1.1.13
+:Version: 1.1.14
 
 .. contents:: Table of contents
   :depth: 2
diff --git a/docs/dht_rss.rst b/docs/dht_rss.rst
index 24a3a8531..d7e71c9cd 100644
--- a/docs/dht_rss.rst
+++ b/docs/dht_rss.rst
@@ -3,7 +3,7 @@ BitTorrent extension for DHT RSS feeds
 ======================================
 
 :Author: Arvid Norberg, arvid@libtorrent.org
-:Version: 1.1.13
+:Version: 1.1.14
 
 .. contents:: Table of contents
   :depth: 2
diff --git a/docs/dht_sec.rst b/docs/dht_sec.rst
index e7d99396e..be559ebef 100644
--- a/docs/dht_sec.rst
+++ b/docs/dht_sec.rst
@@ -3,7 +3,7 @@ BitTorrent DHT security extension
 =================================
 
 :Author: Arvid Norberg, arvid@libtorrent.org
-:Version: 1.1.13
+:Version: 1.1.14
 
 .. contents:: Table of contents
   :depth: 2
diff --git a/docs/dht_store.rst b/docs/dht_store.rst
index 57f9641a6..6d269d41e 100644
--- a/docs/dht_store.rst
+++ b/docs/dht_store.rst
@@ -3,7 +3,7 @@ BitTorrent extension for arbitrary DHT store
 ============================================
 
 :Author: Arvid Norberg, arvid@libtorrent.org
-:Version: 1.1.13
+:Version: 1.1.14
 
 .. contents:: Table of contents
   :depth: 2
diff --git a/docs/examples.rst b/docs/examples.rst
index c254bf039..220e193d6 100644
--- a/docs/examples.rst
+++ b/docs/examples.rst
@@ -3,7 +3,7 @@ libtorrent Examples
 ===================
 
 :Author: Arvid Norberg, arvid@libtorrent.org
-:Version: 1.1.13
+:Version: 1.1.14
 
 .. contents:: Table of contents
   :depth: 2
diff --git a/docs/features.rst b/docs/features.rst
index d2e403e3d..cebbd32f8 100644
--- a/docs/features.rst
+++ b/docs/features.rst
@@ -3,7 +3,7 @@ libtorrent manual
 =================
 
 :Author: Arvid Norberg, arvid@libtorrent.org
-:Version: 1.1.13
+:Version: 1.1.14
 
 .. contents:: Table of contents
   :depth: 2
diff --git a/docs/index.rst b/docs/index.rst
index 9b852366f..ca1699689 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -1,5 +1,5 @@
 :Author: Arvid Norberg, arvid@libtorrent.org
-:Version: 1.1.13
+:Version: 1.1.14
 
 .. raw:: html
 
diff --git a/docs/troubleshooting.rst b/docs/troubleshooting.rst
index e3a392404..395b71721 100644
--- a/docs/troubleshooting.rst
+++ b/docs/troubleshooting.rst
@@ -3,7 +3,7 @@ libtorrent manual
 =================
 
 :Author: Arvid Norberg, arvid@libtorrent.org
-:Version: 1.1.13
+:Version: 1.1.14
 
 .. contents:: Table of contents
   :depth: 2
diff --git a/docs/tuning.rst b/docs/tuning.rst
index 17a56e802..58313b76c 100644
--- a/docs/tuning.rst
+++ b/docs/tuning.rst
@@ -3,7 +3,7 @@ libtorrent manual
 =================
 
 :Author: Arvid Norberg, arvid@libtorrent.org
-:Version: 1.1.13
+:Version: 1.1.14
 
 .. contents:: Table of contents
   :depth: 2
diff --git a/docs/tutorial.rst b/docs/tutorial.rst
index 7a0f46abf..8285eba47 100644
--- a/docs/tutorial.rst
+++ b/docs/tutorial.rst
@@ -3,7 +3,7 @@ libtorrent manual
 =================
 
 :Author: Arvid Norberg, arvid@libtorrent.org
-:Version: 1.1.13
+:Version: 1.1.14
 
 .. contents:: Table of contents
   :depth: 2
diff --git a/docs/utp.rst b/docs/utp.rst
index 9c1295ca8..bf283feaa 100644
--- a/docs/utp.rst
+++ b/docs/utp.rst
@@ -3,7 +3,7 @@ libtorrent manual
 =================
 
 :Author: Arvid Norberg, arvid@libtorrent.org
-:Version: 1.1.13
+:Version: 1.1.14
 
 .. contents:: Table of contents
   :depth: 2
diff --git a/include/libtorrent/resolver.hpp b/include/libtorrent/resolver.hpp
index f713da9aa..b61d2d2a3 100644
--- a/include/libtorrent/resolver.hpp
+++ b/include/libtorrent/resolver.hpp
@@ -64,7 +64,10 @@ struct TORRENT_EXTRA_EXPORT resolver TORRENT_FINAL : resolver_interface
 private:
 
 	void on_lookup(error_code const& ec, tcp::resolver::iterator i
-		, resolver_interface::callback_t h, std::string hostname);
+		, resolver_interface::callback_t const& h, std::string const& hostname);
+
+	void callback(resolver_interface::callback_t const& h
+		, error_code const& ec, std::vector<address> const& ips);
 
 	struct dns_cache_entry
 	{
diff --git a/include/libtorrent/torrent.hpp b/include/libtorrent/torrent.hpp
index de3e37d26..8702826a8 100644
--- a/include/libtorrent/torrent.hpp
+++ b/include/libtorrent/torrent.hpp
@@ -778,6 +778,7 @@ namespace libtorrent
 		{
 			if (!valid_metadata()) return false;
 			if (!has_picker()) return m_have_all;
+			if (index < 0 || index >= torrent_file().num_pieces()) return false;
 			return m_picker->have_piece(index);
 		}
 
diff --git a/include/libtorrent/version.hpp b/include/libtorrent/version.hpp
index f982a9295..82e46f5d1 100644
--- a/include/libtorrent/version.hpp
+++ b/include/libtorrent/version.hpp
@@ -37,14 +37,14 @@ POSSIBILITY OF SUCH DAMAGE.
 
 #define LIBTORRENT_VERSION_MAJOR 1
 #define LIBTORRENT_VERSION_MINOR 1
-#define LIBTORRENT_VERSION_TINY 13
+#define LIBTORRENT_VERSION_TINY 14
 
 // the format of this version is: MMmmtt
 // M = Major version, m = minor version, t = tiny version
 #define LIBTORRENT_VERSION_NUM ((LIBTORRENT_VERSION_MAJOR * 10000) + (LIBTORRENT_VERSION_MINOR * 100) + LIBTORRENT_VERSION_TINY)
 
-#define LIBTORRENT_VERSION "1.1.13.0"
-#define LIBTORRENT_REVISION "9b0ebc207"
+#define LIBTORRENT_VERSION "1.1.14.0"
+#define LIBTORRENT_REVISION "934c75a85"
 
 namespace libtorrent {
 
diff --git a/src/choker.cpp b/src/choker.cpp
index 88b40ab6a..82f4c373b 100644
--- a/src/choker.cpp
+++ b/src/choker.cpp
@@ -200,10 +200,10 @@ namespace libtorrent
 		//   0%    num have pieces     100%
 		int t1_total = t1->torrent_file().num_pieces();
 		int t2_total = t2->torrent_file().num_pieces();
-		int score1 = (lhs->num_have_pieces() < t1_total / 2
-			? t1_total - lhs->num_have_pieces() : lhs->num_have_pieces()) * 1000 / t1_total;
-		int score2 = (rhs->num_have_pieces() < t2_total / 2
-			? t2_total - rhs->num_have_pieces() : rhs->num_have_pieces()) * 1000 / t2_total;
+		int score1 = t1_total == 0 ? 0 : ((lhs->num_have_pieces() < t1_total / 2
+			? t1_total - lhs->num_have_pieces() : lhs->num_have_pieces()) * 1000 / t1_total);
+		int score2 = t2_total == 0 ? 0 : ((rhs->num_have_pieces() < t2_total / 2
+			? t2_total - rhs->num_have_pieces() : rhs->num_have_pieces()) * 1000 / t2_total);
 		if (score1 > score2) return true;
 		if (score2 > score1) return false;
 
diff --git a/src/entry.cpp b/src/entry.cpp
index 2e0991515..d3506cd5f 100644
--- a/src/entry.cpp
+++ b/src/entry.cpp
@@ -357,6 +357,7 @@ namespace libtorrent
 	// convert a bdecode_node into an old skool entry
 	void entry::operator=(bdecode_node const& e)
 	{
+		destruct();
 		switch (e.type())
 		{
 			case bdecode_node::string_t:
@@ -386,7 +387,6 @@ namespace libtorrent
 				break;
 			}
 			case bdecode_node::none_t:
-				destruct();
 				break;
 		}
 	}
@@ -395,6 +395,7 @@ namespace libtorrent
 	// convert a lazy_entry into an old skool entry
 	void entry::operator=(lazy_entry const& e)
 	{
+		destruct();
 		switch (e.type())
 		{
 			case lazy_entry::string_t:
@@ -424,7 +425,6 @@ namespace libtorrent
 				break;
 			}
 			case lazy_entry::none_t:
-				destruct();
 				break;
 		}
 	}
diff --git a/src/file.cpp b/src/file.cpp
index a792f6a6e..ad1f198a3 100644
--- a/src/file.cpp
+++ b/src/file.cpp
@@ -501,7 +501,14 @@ namespace libtorrent
 		if (ec != boost::system::errc::no_such_file_or_directory)
 			return;
 		ec.clear();
-		if (is_root_path(f)) return;
+		if (is_root_path(f))
+		{
+			// this is just to set ec correctly, in case this root path isn't
+			// mounted
+			file_status s;
+			stat_file(f, &s, ec);
+			return;
+		}
 		if (has_parent_path(f))
 		{
 			create_directories(parent_path(f), ec);
diff --git a/src/http_connection.cpp b/src/http_connection.cpp
index 15f6ef9ac..21e7ccfb6 100644
--- a/src/http_connection.cpp
+++ b/src/http_connection.cpp
@@ -187,12 +187,12 @@ void http_connection::get(std::string const& url, time_duration timeout, int pri
 			request << "Proxy-Authorization: Basic " << base64encode(
 				ps->username + ":" + ps->password) << "\r\n";
 
-		hostname = ps->hostname;
-		port = ps->port;
-
 		request << "Host: " << hostname;
 		if (port != default_port) request << ":" << port << "\r\n";
 		else request << "\r\n";
+
+		hostname = ps->hostname;
+		port = ps->port;
 	}
 	else
 	{
diff --git a/src/http_parser.cpp b/src/http_parser.cpp
index 16ddc4833..7f5775a81 100644
--- a/src/http_parser.cpp
+++ b/src/http_parser.cpp
@@ -373,7 +373,8 @@ restart_response:
 					int header_size;
 					if (parse_chunk_header(buf, &chunk_size, &header_size))
 					{
-						if (chunk_size < 0)
+						if (chunk_size < 0
+							|| chunk_size > std::numeric_limits<boost::int64_t>::max() - m_cur_chunk_end - header_size)
 						{
 							m_state = error_state;
 							error = true;
diff --git a/src/resolver.cpp b/src/resolver.cpp
index 20753c15d..2708e31f8 100644
--- a/src/resolver.cpp
+++ b/src/resolver.cpp
@@ -45,8 +45,18 @@ namespace libtorrent
 		, m_timeout(seconds(1200))
 	{}
 
+	void resolver::callback(resolver_interface::callback_t const& h
+		, error_code const& ec, std::vector<address> const& ips)
+	{
+		try {
+			h(ec, ips);
+		} catch (std::exception&) {
+			TORRENT_ASSERT(false);
+		}
+	}
+
 	void resolver::on_lookup(error_code const& ec, tcp::resolver::iterator i
-		, resolver_interface::callback_t h, std::string hostname)
+		, resolver_interface::callback_t const& h, std::string const& hostname)
 	{
 #if defined TORRENT_ASIO_DEBUGGING
 		complete_async("resolver::on_lookup");
@@ -54,7 +64,7 @@ namespace libtorrent
 		if (ec)
 		{
 			std::vector<address> empty;
-			h(ec, empty);
+			callback(h, ec, empty);
 			return;
 		}
 
@@ -68,7 +78,7 @@ namespace libtorrent
 			++i;
 		}
 
-		h(ec, ce.addresses);
+		callback(h, ec, ce.addresses);
 
 		// if m_cache grows too big, weed out the
 		// oldest entries
@@ -98,7 +108,7 @@ namespace libtorrent
 		{
 			std::vector<address> addresses;
 			addresses.push_back(ip);
-			m_ios.post(boost::bind(h, ec, addresses));
+			m_ios.post(boost::bind(&resolver::callback, this, h, ec, addresses));
 			return;
 		}
 		ec.clear();
@@ -110,7 +120,8 @@ namespace libtorrent
 			if ((flags & resolver_interface::cache_only)
 				|| i->second.last_seen + m_timeout >= aux::time_now())
 			{
-				m_ios.post(boost::bind(h, ec, i->second.addresses));
+				std::vector<address> ips = i->second.addresses;
+				m_ios.post(boost::bind(&resolver::callback, this, h, ec, ips));
 				return;
 			}
 		}
@@ -118,7 +129,7 @@ namespace libtorrent
 		if (flags & resolver_interface::cache_only)
 		{
 			// we did not find a cache entry, fail the lookup
-			m_ios.post(boost::bind(h, boost::asio::error::host_not_found
+			m_ios.post(boost::bind(&resolver::callback, this, h, boost::asio::error::host_not_found
 					, std::vector<address>()));
 			return;
 		}
diff --git a/src/settings_pack.cpp b/src/settings_pack.cpp
index c5d9c6ec4..18647abac 100644
--- a/src/settings_pack.cpp
+++ b/src/settings_pack.cpp
@@ -148,7 +148,7 @@ namespace libtorrent
 		SET_NOPREV(proxy_username, "", &session_impl::update_proxy),
 		SET_NOPREV(proxy_password, "", &session_impl::update_proxy),
 		SET_NOPREV(i2p_hostname, "", &session_impl::update_i2p_bridge),
-		SET_NOPREV(peer_fingerprint, "-LT11D0-", 0),
+		SET_NOPREV(peer_fingerprint, "-LT11E0-", 0),
 		SET_NOPREV(dht_bootstrap_nodes, "dht.libtorrent.org:25401", &session_impl::update_dht_bootstrap_nodes)
 	};
 
diff --git a/src/socket_type.cpp b/src/socket_type.cpp
index cf3826658..cf6101fbe 100644
--- a/src/socket_type.cpp
+++ b/src/socket_type.cpp
@@ -167,7 +167,7 @@ namespace libtorrent
 #define MAYBE_ASIO_DEBUGGING
 #endif
 
-	char const buffer[] = "";
+	static char const buffer[] = "";
 	// chasing the async_shutdown by a write is a trick to close the socket as
 	// soon as we've sent the close_notify, without having to wait to receive a
 	// response from the other end
diff --git a/src/storage.cpp b/src/storage.cpp
index 2dd034510..99fd74956 100644
--- a/src/storage.cpp
+++ b/src/storage.cpp
@@ -1244,7 +1244,7 @@ namespace libtorrent
 		// check to see if any of the files exist
 		file_storage const& f = files();
 
-		if (flags == fail_if_exist)
+		if ((flags & 0x3) == fail_if_exist)
 		{
 			file_status s;
 			error_code err;
@@ -1314,7 +1314,7 @@ namespace libtorrent
 			std::string const old_path = combine_path(m_save_path, f.file_path(i));
 			std::string const new_path = combine_path(save_path, f.file_path(i));
 
-			if (flags == dont_replace && exists(new_path))
+			if ((flags & 0x3) == dont_replace && exists(new_path))
 			{
 				if (ret == piece_manager::no_error) ret = piece_manager::need_full_check;
 				// this is a new file, clear our cached version
diff --git a/test/swarm_suite.cpp b/test/swarm_suite.cpp
index 51ede5a99..fe0e8843b 100644
--- a/test/swarm_suite.cpp
+++ b/test/swarm_suite.cpp
@@ -170,8 +170,8 @@ void test_swarm(int flags)
 	TEST_CHECK(tor2.status().is_seeding);
 	TEST_CHECK(tor3.status().is_seeding);
 
-	float average2 = sum_dl_rate2 / float(count_dl_rates2);
-	float average3 = sum_dl_rate3 / float(count_dl_rates3);
+	float average2 = count_dl_rates2 ? sum_dl_rate2 / float(count_dl_rates2) : 0.f;
+	float average3 = count_dl_rates3 ? sum_dl_rate3 / float(count_dl_rates3) : 0.f;
 
 	std::cerr << average2 << std::endl;
 	std::cerr << "average rate: " << (average2 / 1000.f) << "kB/s - "
