aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
authorLinus Torvalds <torvalds@linux-foundation.org>2026-04-21 11:46:22 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-04-21 11:46:22 -0700
commite2683c8868d03382da7e1ce8453b543a043066d1 (patch)
tree2b6c80ee33679753fc61114835fe89534d5e71ce /lib
parent6fdca3c5ab55d6a74277efcae2db9828f567a06a (diff)
parente9af4f47d4a036b4be67e4be361f62e05081f7bf (diff)
downloadlinux-next-history-e2683c8868d03382da7e1ce8453b543a043066d1.tar.gz
Merge tag 'libcrypto-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux
Pull more crypto library updates from Eric Biggers: "Crypto library fix and documentation update: - Fix an integer underflow in the mpi library - Improve the crypto library documentation" * tag 'libcrypto-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux: lib/crypto: docs: Add rst documentation to Documentation/crypto/ docs: kdoc: Expand 'at_least' when creating parameter list lib/crypto: mpi: Fix integer underflow in mpi_read_raw_from_sgl()
Diffstat (limited to 'lib')
-rw-r--r--lib/crypto/mpi/mpicoder.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/crypto/mpi/mpicoder.c b/lib/crypto/mpi/mpicoder.c
index bf716a03c7045..9359a58c29ec0 100644
--- a/lib/crypto/mpi/mpicoder.c
+++ b/lib/crypto/mpi/mpicoder.c
@@ -347,7 +347,7 @@ MPI mpi_read_raw_from_sgl(struct scatterlist *sgl, unsigned int nbytes)
lzeros = 0;
len = 0;
while (nbytes > 0) {
- while (len && !*buff) {
+ while (len && !*buff && lzeros < nbytes) {
lzeros++;
len--;
buff++;