Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed961581 authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Martin Schwidefsky
Browse files

[S390] prng: fix pointer arithmetic



The git commit c708c57e fixed the
access beyond the end of the stack in prng_seed but the pointer
arithmetic is still incorrect. The calculation has been off by
a factor of 64, now it is only off by a factor of 8. prng_seed
is called with a maximum of 16 for nbytes, small enough that
the incorrect calculation stays insides the limits of the stack.
Place parentheses for correct pointer arithmetic.

Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 8e10cd74
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ static void prng_seed(int nbytes)

	/* Add the entropy */
	while (nbytes >= 8) {
		*((__u64 *)parm_block) ^= *((__u64 *)buf+i);
		*((__u64 *)parm_block) ^= *((__u64 *)(buf+i));
		prng_add_entropy();
		i += 8;
		nbytes -= 8;