diff options
author | Gerald Carter <jerry@samba.org> | 2006-07-25 19:59:35 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:38:21 -0500 |
commit | 18feaab9d556c4bd41a19823b3982e2bc30a2055 (patch) | |
tree | 9037b985763eeba6940ae7c97e9ac81ddefc307e /source3 | |
parent | 74cd692d9b34ef8344a36d3b01bd24fa9108d9b6 (diff) | |
download | samba-18feaab9d556c4bd41a19823b3982e2bc30a2055.tar.gz samba-18feaab9d556c4bd41a19823b3982e2bc30a2055.tar.bz2 samba-18feaab9d556c4bd41a19823b3982e2bc30a2055.zip |
r17239: BUG 3959: patch from William Charles <william@charles.name> to fix a segv in the DNS SRV lookups dur to calling rand()
(This used to be commit be12519fd8a7ccd8400fd298e05921eda56b4e16)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libads/dns.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/source3/libads/dns.c b/source3/libads/dns.c index 570f9583f0..558c7f75ba 100644 --- a/source3/libads/dns.c +++ b/source3/libads/dns.c @@ -245,17 +245,11 @@ static BOOL ads_dns_parse_rr_ns( 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 ) |