From a68fb6c85bfc35a6eb5b7ed3a60c44eea68d9413 Mon Sep 17 00:00:00 2001 From: lloyd Date: Sun, 13 Jun 2010 16:08:43 +0000 Subject: Use strncpy instead of strcpy in EGD reader --- src/entropy/egd/es_egd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/entropy') diff --git a/src/entropy/egd/es_egd.cpp b/src/entropy/egd/es_egd.cpp index bd8dc8590..29880a544 100644 --- a/src/entropy/egd/es_egd.cpp +++ b/src/entropy/egd/es_egd.cpp @@ -46,7 +46,7 @@ int EGD_EntropySource::EGD_Socket::open_socket(const std::string& path) if(sizeof(addr.sun_path) < path.length() + 1) throw std::invalid_argument("EGD socket path is too long"); - std::strcpy(addr.sun_path, path.c_str()); + std::strncpy(addr.sun_path, path.c_str(), sizeof(addr.sun_path)); int len = sizeof(addr.sun_family) + std::strlen(addr.sun_path) + 1; -- cgit v1.2.3