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

[Minios-devel] [UNIKRAFT PATCH v2 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, 16 Oct 2019 15:41:40 +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=3OlTnXizPA3bkaksWDP5xu2OJGmtQl1RwiMQwucsBnc=; b=D8UFi0+kHMNueypW6b153KjJzcBwiQ2vrd8WR68mx8ccbmPxU4GY18rEslv3Gcb1UL47k4SIK+Gm4NtZuuj+3DIj6o0J8F8PqRvpffJuHnguQsYLg/SI1RsLRGpArxLXnhYEBfNKIyoSp9mfAxuz2qMe0kTqIxf1NluwSjVudw06mbpmOFOxX3AkU+kCegb4bxE+1dA2M39BJ+4tmdwoYc3vuY86zjJtJaxHXz7EhqgjOK+9kDiA+nYGOEPI3EIzcbBbjeMn6ze8EhLcIx5TyEy2uMJSHECW+5J5beh2FRfvzjUaAKalAWm3J4bL+jxr9wQTZuyQcgk/R7LondicoQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P3oBpEu1F+cqYZoEsTcjox5rz7vk2KjqbqX33XISk0se8W7MuJxLlh2ICaoIYeczqTTuLqWFLsGv3fWshYTqyIVV8meIvH0RIwaASBdasoMgtMrq201NaPqOhJBIcwIiUf7PiDc2P9Pq1LHikI1+TTk3xvHWngIn777W4ikz6tBMn5iXP51MbufFCShRIjGKzMdKMjs35HDt59tmy0xVXggLAfxrlVwGp5WiTP/O0Bsg0NOLCnI6XmFUh2gWTqNFno72qg0Kw+xA2wjTsutzCszMwU0MGMmUIwc03/ipntHP9JCJiWGuZpRMKLvT3IeIhE74A098nsSp9QWSqD2dvA==
  • 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, 16 Oct 2019 15:42:04 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Thread-index: AQHVhDg0BRY05QBNF02K+toHXEl27A==
  • Thread-topic: [UNIKRAFT PATCH v2 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>
---
 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 d98bb0df..f307b8f3 100644
--- a/lib/ukswrand/swrand.c
+++ b/lib/ukswrand/swrand.c
@@ -41,7 +41,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®.