Your message dated Mon, 23 Aug 2021 17:07:38 +0200
with message-id <[email protected]>
and subject line Re: mingw-w64-i686-dev: non-conforming snprintf function in
case of truncation
has caused the Debian Bug report #948598,
regarding mingw-w64-i686-dev: non-conforming snprintf function in case of
truncation
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
948598: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=948598
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: mingw-w64-i686-dev
Version: 7.0.0-2
Severity: normal
Consider the following program:
#include <stdio.h>
int main (void)
{
char buf[8] = { 0 };
int r;
r = snprintf (buf, 3, "abcdef");
printf ("r = %d, buf = \"%s\"\n", r, buf);
return 0;
}
When compiling with i686-w64-mingw32-gcc and running under Wine,
I get:
r = -1, buf = "abc"
which is incorrect. Adding the -posix option when compiling solves
the issue, i.e. I get
r = 6, buf = "ab"
but the snprintf function is not specific to POSIX.
-- System Information:
Debian Release: bullseye/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'stable-updates'), (500,
'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 5.4.0-2-amd64 (SMP w/12 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE,
TAINT_UNSIGNED_MODULE
Locale: LANG=POSIX, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=POSIX
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages mingw-w64-i686-dev depends on:
ii mingw-w64-common 7.0.0-2
mingw-w64-i686-dev recommends no packages.
Versions of packages mingw-w64-i686-dev suggests:
ii wine [wine] 5.0~rc1-2
-- no debconf information
--
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
--- End Message ---
--- Begin Message ---
Version: 8.0.0-1
On 2020-01-10 17:53:40 +0100, Vincent Lefevre wrote:
> Package: mingw-w64-i686-dev
> Version: 7.0.0-2
> Severity: normal
>
> Consider the following program:
>
> #include <stdio.h>
>
> int main (void)
> {
> char buf[8] = { 0 };
> int r;
>
> r = snprintf (buf, 3, "abcdef");
> printf ("r = %d, buf = \"%s\"\n", r, buf);
>
> return 0;
> }
>
> When compiling with i686-w64-mingw32-gcc and running under Wine,
> I get:
>
> r = -1, buf = "abc"
>
> which is incorrect. Adding the -posix option when compiling solves
> the issue, i.e. I get
>
> r = 6, buf = "ab"
>
> but the snprintf function is not specific to POSIX.
I could test that this was fixed in the current version (8.0.0-1).
So, closing.
Note: the upstream bug has been closed today, but the bug was actually
fixed last year and the fix is included upstream in v8.0.0.
Thanks to Pali Rohár for the fix and for the information.
--
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
--- End Message ---