diff --git a/cpp/include/kvikio/shim/libcurl.hpp b/cpp/include/kvikio/shim/libcurl.hpp index 635ea4c7fd..39c3e89320 100644 --- a/cpp/include/kvikio/shim/libcurl.hpp +++ b/cpp/include/kvikio/shim/libcurl.hpp @@ -163,8 +163,14 @@ class CurlHandle { _source_line(std::move(source_line)) { // Removing all '\0' characters + auto _source_file_size = _source_file.size(); _source_file.erase(std::remove(_source_file.begin(), _source_file.end(), '\0'), _source_file.end()); + if(_source_file_size != _source_file.size()) { + std::stringstream ss; + ss << "CurlHandle - `source_file` contains " << _source_file_size - _source_file.size() << " '\\0' chars?!?"; + throw std::runtime_error(ss.str()); + } // Need CURLOPT_NOSIGNAL to support threading, see //