Properly initialize UUID used in Fingerprint class. Fixes #1721

This commit is contained in:
Daniel Patterson 2015-10-03 09:18:10 -07:00
parent 8f8bd05f83
commit cf45b2cddb

View File

@ -28,6 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "osrm_exception.hpp"
#include <boost/uuid/name_generator.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <cstring>
@ -47,6 +48,13 @@ FingerPrint FingerPrint::GetValid()
fingerprint.magic_number = 1297240911;
fingerprint.md5_prepare[32] = fingerprint.md5_tree[32] = fingerprint.md5_graph[32] = fingerprint.md5_objects[32] = '\0';
// 6ba7b810-9dad-11d1-80b4-00c04fd430c8 is a Well Known UUID representing the DNS
// namespace. Its use here indicates that we own this part of the UUID space
// in the DNS realm. *Usually*, we would then generate a UUID based on "something.project-osrm.org",
// but this whole class is a hack. Anyway, named_uuid needs to be initialized to something
// before it can be used, and this is as good as anything else for these purposes.
fingerprint.named_uuid = boost::uuids::string_generator()( "{6ba7b810-9dad-11d1-80b4-00c04fd430c8}");
boost::uuids::name_generator gen(fingerprint.named_uuid);
std::string temp_string;