diff options
author | Gerald Carter <jerry@samba.org> | 2006-07-25 19:59:35 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2006-07-25 19:59:35 +0000 |
commit | c6d20fa79db1eef931575574d49290a8dcd31213 (patch) | |
tree | a90a7b1142256580b4953cf5e5015c7f0816c6a6 /source/libads/dns.c | |
parent | a7110d7295470ea8c03c33fa039f3a79ec678209 (diff) | |
download | samba-c6d20fa79db1eef931575574d49290a8dcd31213.tar.gz samba-c6d20fa79db1eef931575574d49290a8dcd31213.tar.xz samba-c6d20fa79db1eef931575574d49290a8dcd31213.zip |
r17239: BUG 3959: patch from William Charles <william@charles.name> to fix a segv in the DNS SRV lookups dur to calling rand()
Diffstat (limited to 'source/libads/dns.c')
-rw-r--r-- | source/libads/dns.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/source/libads/dns.c b/source/libads/dns.c index 321b4355277..f6dc3f59314 100644 --- a/source/libads/dns.c +++ b/source/libads/dns.c @@ -204,17 +204,11 @@ static BOOL ads_dns_parse_rr_srv( TALLOC_CTX *ctx, uint8 *start, uint8 *end, static int dnssrvcmp( struct dns_rr_srv *a, struct dns_rr_srv *b ) { - BOOL init = False; - - if ( !init ) { - srand( (uint32)time(NULL) ); - } - if ( a->priority == b->priority ) { /* randomize entries with an equal weight and priority */ if ( a->weight == b->weight ) - return rand() % 2 ? -1 : 1; + return 0; /* higher weights should be sorted lower */ if ( a->weight > b->weight ) |