lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CA+XYpCAq24zaDb-mnWqjs3N2SvbXsGLiT1COzWqQJnaKivb1hw@mail.gmail.com>
Date: Wed, 2 Jul 2025 20:24:32 +0800
From: Jake <jakecontactxyz@...il.com>
To: linux-kernel@...r.kernel.org
Cc: akpm@...ux-foundation.org
Subject: [PATCH] vsnprintf: POSIX compliance for return value length

Greetings.

The current implementation of vsnprintf() returns the number of characters
actually written to the buffer, which does not comply with the POSIX
specification. POSIX requires vsnprintf() to return the number of characters
it *would* have written, even if that exceeds the buffer size, so callers
can
detect truncation.

This patch adds a `total_len` counter, updates all output paths to increment
it, and returns `total_len` instead of the truncated output count.

Signed-off-by: Jake <jakecontactxyz@...il.com>

Content of type "text/html" skipped

Download attachment "vsnprintf_patch.zip" of type "application/zip" (1384 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ