[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Minios-devel] [UNIKRAFT PATCH v5 4/4] lib/ukswrand: Fix uk_swrand_fill_buffer to fill the entire buffer
- To: "minios-devel@xxxxxxxxxxxxx" <minios-devel@xxxxxxxxxxxxx>
- From: Vlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
- Date: Wed, 27 Nov 2019 12:41:50 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=stud.acs.upb.ro; dmarc=pass action=none header.from=stud.acs.upb.ro; dkim=pass header.d=stud.acs.upb.ro; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rFoJ3fE2n2tq8Lqy1yNlyedx/tSO1Qtt4WM3mjMXk2Y=; b=Q8JzcJljKjJZAOJo7HrdnzhYlgM/Xk9vovUAieKO87Ys89V3EtDwrjvbns8cxgJQfnqE28QksyjDEIIlr5SfaPXnV74/kspyAdQpEdbefQgHkQI3DTMRe2SCjCAR3YwA+BYuEe5gJlnhfS52rHFKGLVDontJN8d74Mwdy2GbBctvydQIp36YRzW/d7rNUCvB8qb88x+xa8p5tYnMJM+3JKuVKOCaFVSTf2nbqocvxDxLyxoOqRfVXrRdtdJWYYqi2fPGc4f2q+2op41aQ+cLfm3+SuANYMbu9UntRQ6iZBdV/dz2klvW6fzcL8ymliB8CZfDKVs62kmNIJOMUmGMQg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fn8JxwYEQLO7wCP9kQvHhewm90jQWjzIgvQHeFWdsnLYzCDNNFZxjW7yNLR8p+iCJH8Jv8tzpR4liHV0yh4IhZ/+KIrgzB1uT3HaGiHqnWslnXT/hIT4Gq5HfB7QfKKK4Ax1od6Hffk9O3ANGU7s/+Ck+f66FfH/Op92yHTPvIT6PrHrIx7dWwSCLY7+vYTiVUuD5FoLK4ffvSpU83kSc6n8DlJx1QMGxKQ0OM1pDB0uUSaBOR/zCASIK7zmlukt/mLnksjfpIIrmMoV1uft0cTlpXDo0pAEnqHDd6xUQ6fuHKKYKS3fqP3T8rXq4229oPTjM2rlg1Ym4tS7gtufXw==
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=vlad_andrei.badoiu@xxxxxxxxxxxxxxx;
- Cc: "felipe.huici@xxxxxxxxx" <felipe.huici@xxxxxxxxx>, "simon.kuenzer@xxxxxxxxx" <simon.kuenzer@xxxxxxxxx>, Vlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
- Delivery-date: Wed, 27 Nov 2019 12:42:13 +0000
- List-id: Mini-os development list <minios-devel.lists.xenproject.org>
- Thread-index: AQHVpSAKmsd7IX30F0KyRq3qiXufIA==
- Thread-topic: [UNIKRAFT PATCH v5 4/4] lib/ukswrand: Fix uk_swrand_fill_buffer to fill the entire buffer
From: Vlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
uk_swrand_fill_buffer fills only 1 byte per step. We fix this
by casting the buffer to __u32 *.
Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
Reviewed-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
---
lib/ukswrand/swrand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/ukswrand/swrand.c b/lib/ukswrand/swrand.c
index ca267bf0..1225f66b 100644
--- a/lib/ukswrand/swrand.c
+++ b/lib/ukswrand/swrand.c
@@ -66,7 +66,7 @@ ssize_t uk_swrand_fill_buffer(void *buf, size_t buflen)
chunk_size = buflen % step;
for (i = 0; i < buflen - chunk_size; i += step)
- *((char *) buf + i) = uk_swrand_randr();
+ *(__u32 *)((char *) buf + i) = uk_swrand_randr();
/* fill the remaining bytes of the buffer */
if (chunk_size > 0) {
--
2.20.1
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel
|