[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCH v2 4/4] lib/ukswrand: Fix uk_swrand_fill_buffer to fill the entire buffer
Reviewed-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx> On 16.10.19 17:41, Vlad-Andrei BĂDOIU (78692) wrote: 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) { _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |