Page MenuHomeFreeBSD

D28525.diff
No OneTemporary

D28525.diff

diff --git a/usr.sbin/pkg/dns_utils.c b/usr.sbin/pkg/dns_utils.c
--- a/usr.sbin/pkg/dns_utils.c
+++ b/usr.sbin/pkg/dns_utils.c
@@ -87,7 +87,7 @@
int *chosen;
totalweight = 0;
-
+
for (i = 0; i <= last; i++)
totalweight += d[i]->weight;
@@ -98,7 +98,8 @@
for (i = 0; i <= last; i++) {
for (;;) {
- chosen[i] = random() % (d[i]->weight * 100 / totalweight);
+ chosen[i] = arc4random_uniform(d[i]->weight * 100 /
+ totalweight);
for (j = 0; j < i; j++) {
if (chosen[i] == chosen[j])
break;
diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c
--- a/usr.sbin/pkg/pkg.c
+++ b/usr.sbin/pkg/pkg.c
@@ -434,9 +434,7 @@
int ret;
SHA256_CTX sha256;
- my_fd = -1;
fp = NULL;
- r = 0;
ret = 1;
out[0] = '\0';
@@ -627,7 +625,6 @@
ssize_t linelen;
buf = NULL;
- my_fd = -1;
sc = NULL;
line = NULL;
linecap = 0;

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 1, 4:26 PM (22 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14416612
Default Alt Text
D28525.diff (869 B)

Event Timeline