[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Minios-devel] [UNIKRAFT PATCH v4 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, 20 Nov 2019 12:12:57 +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=GZecQTbeXdt8F6l1IYKofHETLavwgu+jNNwiKjMVLghdW5AKmqe9Zu760MshkrrOYfNvXHS2IuDX8Neo/DLBXouLwlTxeUTuCbCRXCtjDkOASO67Nvk9Qqh1Ln08V34pi5R1Xgj+sHrNg5U9j7EUm2Enyy6TLwXqL59ASKo6e4/yRQ0Tiqae3QFUS7TJGY39gSV874Gn3h538yrgaUbK6PY7R0Y9w7BlRKBWfBGWUYMN0ZaTFo58Qk+U6Y41GnQpBofo2JSUinOnHk/CXW4fMmjaQSh4gWkYcgZ0PN4/5WNLIMoH1x/t0rGbRNlt+SNrKs8FzsYK9iZ2lgA5siq4dA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q4VwNw/BESDPq9mRj2rpLnnlnOq2rahVq9aqbN1ZQJhb7fK4ksubun+iHKD0A8t54Hx2YnUEuCo1dxd4AhrcJJe7HPIVCf37vlcYlKLBRcOqPW+Not1fNnqaWiGooPakJgZQa7uJFzav7MLy12NN2QbDanLKbBhUWJdKhBwGujhWJLywrY/zvQdn7qTwjHKLY0k9LgWWYAA15/RLRFa8mNA4NYjf4sHH3f6H7MK/L+mJ1vWWDjfa+Yn6Hef2OGbXL+eYopZB8DQ+UEASCUb5IaLfiIzpBgEzZOISfI2DdpYzuMqN7j1a2JG2c+4DV9tJaSPX8Zw/LRRZiSQ2bWiiQA==
- 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, 20 Nov 2019 12:13:20 +0000
- List-id: Mini-os development list <minios-devel.lists.xenproject.org>
- Thread-index: AQHVn5vYVYNCrZ+cr0CvfHxcDGBaaw==
- Thread-topic: [UNIKRAFT PATCH v4 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
|