aboutsummaryrefslogtreecommitdiffstats
path: root/src/utility/random.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2005-11-28 12:17:47 +0000
committerVincent Richard <[email protected]>2005-11-28 12:17:47 +0000
commit296ce19306f9c9d4358b3a1adc012405efc6c70a (patch)
tree7cc1bbac4b384b8f46f46a1629e3f8d42bfaef31 /src/utility/random.cpp
parentFixed problem with maildir and ':' in filename on Windows. (diff)
downloadvmime-296ce19306f9c9d4358b3a1adc012405efc6c70a.tar.gz
vmime-296ce19306f9c9d4358b3a1adc012405efc6c70a.zip
Fixed buffer overrun in random::getString().
Diffstat (limited to 'src/utility/random.cpp')
-rw-r--r--src/utility/random.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utility/random.cpp b/src/utility/random.cpp
index 882b4ab9..9b505cef 100644
--- a/src/utility/random.cpp
+++ b/src/utility/random.cpp
@@ -65,7 +65,7 @@ const string random::getString(const int length, const string& randomChars)
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];
}