Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148421733
D28525.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
869 B
Referenced Files
None
Subscribers
None
D28525.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 18, 6:22 PM (14 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29919801
Default Alt Text
D28525.diff (869 B)
Attached To
Mode
D28525: pkg(7): address minor nits (mostly clang-analyze complaints)
Attached
Detach File
Event Timeline
Log In to Comment