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

[Minios-devel] [UNIKRAFT PATCH 2/2] 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: Tue, 15 Oct 2019 11:57:37 +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=msbOwITxzq2GbqmVrNQHUDjcxET0OfHiTErGOhxsbOc=; b=kUIbp3DYFgMmE6/hYSrJf+u6LJMhlxsQwjDVDvQLJjSzdv4MzVculxZbhT2ITVdtfrI1GNapPJdFwFpRdJuJ51tGi/FkJ4bFKXD+wxWX+SpCJT+ZJAn/gj/9W7P9FCVtyP2QynozvuxeyfSoxQsddLVtfkoFeR5onorZDxeUzvMj1nZw8ENzmebNRE45ZtgUI+5Fo2YXFzqDM3LtzZkwEr3VzMNqPJpPefaHIdnctwoYjt7XjPdNUMItxEeZ08INF+6ENE3IkX7O+uhN/E+5xFy968CQl5u8wKmRPd7FqEPY7Wvc7WGdaIeThEwgB0wYVFLcXwkenHF5l32O9wELyQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=loNnekmPz0WLQ/4LFJfL832Qk0CncneL4nxxNSI77vtYL6CuVxGawM9FTzGYVluVnU7ms6Qw/y/fwvkuk1plBdeQeSlpI2mfwRg4R0CQEXYug8tF+YPp+n3/mVBuqNvPHVkoajlmSWTviWDz1022os5mKGEn+ceuP97DCicHjJgGUJrJQQkN1VLeyf6neMVnj+x79wNR6stcymti8aNeo0bBN9/gqnt04nBGMoUDBh/mwcwWf5vOEzH0uHiyNdXq4fRAPmH2769tzQlt3Db3gorCm9jHAoGjFbWGD1zgTrmK+lJNzBdlXOr5h94Udz7mjA/256ORP13LsELh62l89Q==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=vlad_andrei.badoiu@xxxxxxxxxxxxxxx;
  • Cc: "felipe.huici@xxxxxxxxx" <felipe.huici@xxxxxxxxx>, "costin.lup@xxxxxxxxx" <costin.lup@xxxxxxxxx>, Vlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 15 Oct 2019 11:57:43 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Thread-index: AQHVg0+8xsNDF3BpTUSqocYypNQWQQ==
  • Thread-topic: [UNIKRAFT PATCH 2/2] 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/mwc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ukswrand/mwc.c b/lib/ukswrand/mwc.c
index 21c91f3a..f12b4290 100644
--- a/lib/ukswrand/mwc.c
+++ b/lib/ukswrand/mwc.c
@@ -98,7 +98,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®.