Skip to content

Commit

Permalink
Properly initialize UUID used in Fingerprint class. Fixes #1721
Browse files Browse the repository at this point in the history
  • Loading branch information
danpat committed Oct 3, 2015
1 parent 8f8bd05 commit cf45b2c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions util/fingerprint_impl.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand All @@ -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;

Expand Down

0 comments on commit cf45b2c

Please sign in to comment.