[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH v3 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: Mon, 21 Oct 2019 11:35:32 +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=gEIt2I/IfpswBduDLKEHIbwpDSMG3AxzzZ3jnONO0M4=; b=l+fiDr7lXGgJn9eii+E+0odOmUQlqHpNd/jM3gv7HsNN38gu3zoyqKaUTLOBwA/ywRoe/J+TTX7a4drbf7jUmeNZbn515o0glbxOrzblqlY92wZkHd835AAQ7qVPs9EBeFFbnntsGQaEeNc1XLvKKTwLkK+KYX1r1MwVBUw1Z19eIiSMLOZwJOc3GW8o7AR6y7qTLfEfuQ2Q9Yn4xx7okpqM690lpp1hWyfAANuABr8v/J5dYfAYEGpLrDVXTiC7ZAwHcVrpq4EobFH2OBi6gd8hERU8rLaxuElTAwHyG2gwPDpMapyOMHZMbxlaC/1+vxiQFzfZxX8QWajfaFdKKg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B9y9OqlNJpidB0x24Hc1SnguWI1btLXm7JX4Hggp24rfVs5UoeRTi7MvMHN+jI6BuftHzoAVDFwItShdQFXZ3peIrImR7YM/dl5aq7X1KxuI5R/oLrUFWE5bpX4px+JPvZLJaupf2LosG34/EE9FPWgmYIz2J+CoN0sdIKvq/wYD0Dc5NJfcQzkL+b8RqSQ58VTA5X5XUxCvqt+TA3k4CDdfYwQMVRdPNmxSaWguNkfMQ8o5i4ZDODXYPUeNXPzivlve+Ou6nq2usq/jRLx5gvB2+1H8URg+BTta2nqFYIPuQQOfpNWMNsMf7HNGRahqvGWoDCKSx6WDUzWqPr68NA==
  • 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: Mon, 21 Oct 2019 11:35:47 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Thread-index: AQHViAOlF752BpVC5UKeL01s3mYVdg==
  • Thread-topic: [UNIKRAFT PATCH v3 4/4] lib/ukswrand: Fix uk_swrand_fill_buffer to fill the entire buffer

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 16ad3496..b698c7cc 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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.