From c48a826c659700646c9d48403694b5c7c292c1c4 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Wed, 7 Oct 2015 13:21:20 +0300 Subject: [PATCH] db: fix string type incorrectly unvalidated We call the conversion function that expectes a NUL terminated string, but provide a string view, which is not. Fix by using the begin/end variant, which doesn't require a NUL terminator. Fixes #437. --- types.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types.cc b/types.cc index 794b9b85ce..866803ffe7 100644 --- a/types.cc +++ b/types.cc @@ -225,7 +225,7 @@ struct string_type_impl : public abstract_type { } } else { try { - boost::locale::conv::utf_to_utf(v.data(), boost::locale::conv::stop); + boost::locale::conv::utf_to_utf(v.data(), v.end(), boost::locale::conv::stop); } catch (const boost::locale::conv::conversion_error& ex) { throw marshal_exception(ex.what()); }