From 7e5655eef4661dcd38e431983dadf20ecdad0c24 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Fri, 4 Nov 2022 13:46:10 +0000 Subject: [PATCH] Use `snprintf` instead of `sprintf` (ref #4361) --- include/mapnik/util/geometry_to_wkb.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/mapnik/util/geometry_to_wkb.hpp b/include/mapnik/util/geometry_to_wkb.hpp index 33604c045..130e00e88 100644 --- a/include/mapnik/util/geometry_to_wkb.hpp +++ b/include/mapnik/util/geometry_to_wkb.hpp @@ -51,7 +51,7 @@ std::string to_hex(const char* blob, std::size_t size) std::memset(hex, 0, 3); for (std::size_t pos = 0; pos < size; ++pos) { - std::sprintf(hex, "%02x", int(blob[pos]) & 0xff); + std::snprintf(hex, 3, "%02x", int(blob[pos]) & 0xff); s << hex; } return s.str();