public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] lib/base64: decode fixes
@ 2026-03-24 22:32 Josh Law
  2026-03-24 22:32 ` [PATCH v2 1/2] lib/base64: validate before writing in decode tail path Josh Law
  2026-03-24 22:32 ` [PATCH v2 2/2] lib/base64: fix copy-pasted @padding doc in base64_decode() Josh Law
  0 siblings, 2 replies; 3+ messages in thread
From: Josh Law @ 2026-03-24 22:32 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Josh Law, linux-kernel

Two small fixes for lib/base64.c:

1. base64_decode() writes a decoded byte to the output buffer before
   validating the input in the trailing-bytes path. Move the validity
   checks before any writes so dst is untouched on invalid input.

2. The @padding kernel-doc for base64_decode() was copy-pasted from
   base64_encode() and describes the wrong direction.

v2: fix bogus Fixes tag in patch 1

Josh Law (2):
  lib/base64: validate before writing in decode tail path
  lib/base64: fix copy-pasted @padding doc in base64_decode()

 lib/base64.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-24 22:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-24 22:32 [PATCH v2 0/2] lib/base64: decode fixes Josh Law
2026-03-24 22:32 ` [PATCH v2 1/2] lib/base64: validate before writing in decode tail path Josh Law
2026-03-24 22:32 ` [PATCH v2 2/2] lib/base64: fix copy-pasted @padding doc in base64_decode() Josh Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox