Bug Fix - UUID corruption on Solaris 8

- Fixed a bug with an unterminated buffer in uuid() (thanks to
  Steven de Brouwer).
- Added Solaris 8 as another supported platform (thanks to Steven
  de Brouwer).
This commit is contained in:
Paul Beckingham 2009-05-12 23:18:32 -04:00
parent f9035eec70
commit 95f07cf363
4 changed files with 8 additions and 1 deletions

View file

@ -208,9 +208,12 @@ const std::string uuid ()
{
uuid_t id;
uuid_generate (id);
char buffer[100];
char buffer[100] = {0};
uuid_unparse_lower (id, buffer);
// Bug found by Steven de Brouwer.
buffer[36] = '\0';
return std::string (buffer);
}
@ -271,6 +274,7 @@ const std::string uuid ()
id[33] = randomHexDigit ();
id[34] = randomHexDigit ();
id[35] = randomHexDigit ();
id[36] = '\0';
return id;
}