diff options
author | Andrew Tridgell <tridge@samba.org> | 2002-07-28 06:08:30 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2002-07-28 06:08:30 +0000 |
commit | c4fcf56380739cc58a2096aefe587bee50fde27d (patch) | |
tree | 60814e20f51939644626f13f2e82d54d758f7142 /source3/lib | |
parent | a5216d2340095ecd71fc8f039ac3bb03b9e61665 (diff) | |
download | samba-c4fcf56380739cc58a2096aefe587bee50fde27d.tar.gz samba-c4fcf56380739cc58a2096aefe587bee50fde27d.tar.bz2 samba-c4fcf56380739cc58a2096aefe587bee50fde27d.zip |
good security patch from Timothy.Sell@unisys.com
we could generate short passwords!
samba-patches 880
(This used to be commit 1466acba7e18f5ce733b376d031f1596a1a674d8)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/genrand.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/lib/genrand.c b/source3/lib/genrand.c index ee8bc0b1d5..fe756169a6 100644 --- a/source3/lib/genrand.c +++ b/source3/lib/genrand.c @@ -259,7 +259,7 @@ char *generate_random_str(size_t len) len = sizeof(retstr) -1; generate_random_buffer( retstr, len, False); for (i = 0; i < len; i++) - retstr[i] = c_list[ retstr[i] % sizeof(c_list) ]; + retstr[i] = c_list[ retstr[i] % (sizeof(c_list)-1) ]; retstr[i] = '\0'; |