From 185d1b9525cb132bc802cdecbc6901ed30d58555 Mon Sep 17 00:00:00 2001 From: Timo Weingärtner Date: Thu, 17 Apr 2014 21:30:27 +0200 Subject: rfc4251string: drop unused and dangerous constructor from just a pointer better use std::istringstream or boost::iostream::array_source --- rfc4251.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/rfc4251.h b/rfc4251.h index e9b94f2..876db07 100644 --- a/rfc4251.h +++ b/rfc4251.h @@ -157,7 +157,6 @@ struct rfc4251string : boost::totally_ordered { std::vector value; rfc4251string () = default; - inline explicit rfc4251string (char const *); inline explicit rfc4251string (char const *, size_t); explicit rfc4251string (std::string const & s) : rfc4251string{s.data(), s.size()} {} explicit rfc4251string (std::vector const &); @@ -170,11 +169,6 @@ struct rfc4251string : boost::totally_ordered { operator mpz_class () const; }; -inline rfc4251string::rfc4251string (char const * s) { - auto len = ntohl(*reinterpret_cast(s)); - value.insert(value.begin(), s + 4, s + 4 + len); -} - inline rfc4251string::rfc4251string (char const * s, size_t l) { if (l > std::numeric_limits::max()) throw std::length_error{"32-bit limit for rfc4251string exceeded"}; -- cgit v1.2.3