mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 00:57:19 +02:00
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:
parent
f9035eec70
commit
95f07cf363
4 changed files with 8 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue