From cce46dae2bfd9b5d30823b66f8f2f8305a3eef4f Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" <114750+alfredh@users.noreply.github.com> Date: Tue, 30 Jul 2024 15:30:08 +0200 Subject: [PATCH] dd: add limit check for count --- src/dd/putbit.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dd/putbit.c b/src/dd/putbit.c index 16954f815..82f734da1 100644 --- a/src/dd/putbit.c +++ b/src/dd/putbit.c @@ -60,6 +60,9 @@ int putbit_write(struct putbit *pb, unsigned count, unsigned val) if (!pb) return EINVAL; + if (count > 32) + return EINVAL; + for (unsigned i=0; i