Fixed buffer overrun in random::getString().
This commit is contained in:
parent
594dfdbd55
commit
296ce19306
@ -7,6 +7,9 @@ VERSION 0.8.1cvs
|
|||||||
* maildirUtils.cpp: fixed problem with ':' in filename on Windows
|
* maildirUtils.cpp: fixed problem with ':' in filename on Windows
|
||||||
platform (thanks to Benjamin Biron).
|
platform (thanks to Benjamin Biron).
|
||||||
|
|
||||||
|
* random.cpp: fixed buffer overrun in random::getString (thanks
|
||||||
|
to Benjamin Biron).
|
||||||
|
|
||||||
2005-11-07 Vincent Richard <vincent@vincent-richard.net>
|
2005-11-07 Vincent Richard <vincent@vincent-richard.net>
|
||||||
|
|
||||||
* SMTPTransport.cpp: fixed bug in disconnect() when authentication is
|
* SMTPTransport.cpp: fixed bug in disconnect() when authentication is
|
||||||
|
@ -65,7 +65,7 @@ const string random::getString(const int length, const string& randomChars)
|
|||||||
|
|
||||||
while (c < length)
|
while (c < length)
|
||||||
{
|
{
|
||||||
for (unsigned int n = random::getNext() ; n != 0 ; n /= x)
|
for (unsigned int n = random::getNext() ; n != 0 && c < length ; n /= x)
|
||||||
{
|
{
|
||||||
res[c++] = randomChars[n % x];
|
res[c++] = randomChars[n % x];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user