#1144171 freehsm-c: FTBFS: src/fhsm_pkcs11.c:3964:53: error: ‘%zu’ directive output may be truncated writing between 1 and 20 bytes into a region of size 12 [-Werror=format-truncation=]

#1144171#5
Date:
2026-08-11 23:16:16 UTC
From:
To:
Dear maintainer:

During a rebuild of all packages in unstable, this package failed to build.

Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:

https://people.debian.org/~sanvila/build-logs/202608/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:freehsm-c, so that this is still
visible in the BTS web page for this package.

Thanks.
--------------------------------------------------------------------------------
[...]
 debian/rules clean
dh clean
   dh_auto_clean
	make -j2 distclean
make[1]: Entering directory '/<<PKGBUILDDIR>>'
rm -f libfreehsm-fips.so src/fhsm_state.o src/fhsm_memory.o src/fhsm_crypto.o src/fhsm_audit.o src/fhsm_pkcs11.o src/fhsm_ecdsa_raw.o src/fhsm_pq_params.o src/fhsm_create_attrs.o src/fhsm_token.o src/fhsm_session.o src/fhsm_integrity.o src/fhsm_pairwise.o src/fhsm_drbg.o src/fhsm_tpm.o src/fhsm_token_tpm.o src/fhsm_mode.o src/dispatch/fhsm_dispatch_legacy.o src/gen/fhsm_dispatch.o src/dispatch/fhsm_dispatch_common.o src/dispatch/fhsm_dispatch_digest.o src/dispatch/fhsm_dispatch_hmac.o src/dispatch/fhsm_dispatch_aes.o src/dispatch/fhsm_dispatch_kdf.o src/dispatch/fhsm_dispatch_pkey.o src/dispatch/fhsm_dispatch_pq.o src/dispatch/fhsm_dispatch_kmac.o src/dispatch/fhsm_dispatch_concat.o src/dispatch/fhsm_dispatch_hybrid.o kat/fhsm_kat_vectors.o kat/cavp_extended.o tests/test_smoke tests/*.o
rm -f freehsm-c-src.tar.xz freehsm-c-src.tar.xz.sha256
rm -rf out/
rm -f include/fhsm_pkcs11_mechanisms.h
rm -f src/gen/fhsm_dispatch.c
rm -f docs/MECHANISMS.md
rm -rf __pycache__ scripts/__pycache__
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
   dh_clean
 debian/rules binary
dh binary
   dh_update_autotools_config
   dh_autoreconf
   dh_auto_configure
   debian/rules override_dh_auto_build
make[1]: Entering directory '/<<PKGBUILDDIR>>'
python3 scripts/gen_p11_thunks.py --profile=fips-strict --root=/<<PKGBUILDDIR>>
[gen_p11_thunks] profile=fips-strict approved=66 non-approved=12 total=78
[gen_p11_thunks] wrote /<<PKGBUILDDIR>>/include/fhsm_pkcs11_mechanisms.h
[gen_p11_thunks] wrote /<<PKGBUILDDIR>>/src/gen/fhsm_dispatch.c
[gen_p11_thunks] wrote /<<PKGBUILDDIR>>/docs/MECHANISMS.md
make libfreehsm-fips.so
make[2]: Entering directory '/<<PKGBUILDDIR>>'
cc -Wall -Wextra -Wpedantic -Werror -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wnested-externs -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wstrict-aliasing=2 -Wformat=2 -Wformat-security -Wno-format-nonliteral -Wnull-dereference -Wdouble-promotion -Wconversion -Wno-sign-conversion -Wno-unused-parameter -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -fstack-clash-protection -fcf-protection=full -fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer -DOPENSSL_API_COMPAT=0x30000000L -ffile-prefix-map=/<<PKGBUILDDIR>>= -fdebug-prefix-map=/<<PKGBUILDDIR>>= -frandom-seed=fhsm-1.4.0-FIPS -Wno-builtin-macro-redefined -D__DATE__='"redacted"' -D__TIME__='"redacted"' -g3 -O2 -std=c11 -D_GNU_SOURCE -Iinclude -I/usr/local/ssl/include -Isrc/dispatch -c -o src/fhsm_state.o src/fhsm_state.c
cc -Wall -Wextra -Wpedantic -Werror -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wnested-externs -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wstrict-aliasing=2 -Wformat=2 -Wformat-security -Wno-format-nonliteral -Wnull-dereference -Wdouble-promotion -Wconversion -Wno-sign-conversion -Wno-unused-parameter -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -fstack-clash-protection -fcf-protection=full -fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer -DOPENSSL_API_COMPAT=0x30000000L -ffile-prefix-map=/<<PKGBUILDDIR>>= -fdebug-prefix-map=/<<PKGBUILDDIR>>= -frandom-seed=fhsm-1.4.0-FIPS -Wno-builtin-macro-redefined -D__DATE__='"redacted"' -D__TIME__='"redacted"' -g3 -O2 -std=c11 -D_GNU_SOURCE -Iinclude -I/usr/local/ssl/include -Isrc/dispatch -c -o src/fhsm_memory.o src/fhsm_memory.c
cc -Wall -Wextra -Wpedantic -Werror -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wnested-externs -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wstrict-aliasing=2 -Wformat=2 -Wformat-security -Wno-format-nonliteral -Wnull-dereference -Wdouble-promotion -Wconversion -Wno-sign-conversion -Wno-unused-parameter -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -fstack-clash-protection -fcf-protection=full -fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer -DOPENSSL_API_COMPAT=0x30000000L -ffile-prefix-map=/<<PKGBUILDDIR>>= -fdebug-prefix-map=/<<PKGBUILDDIR>>= -frandom-seed=fhsm-1.4.0-FIPS -Wno-builtin-macro-redefined -D__DATE__='"redacted"' -D__TIME__='"redacted"' -g3 -O2 -std=c11 -D_GNU_SOURCE -Iinclude -I/usr/local/ssl/include -Isrc/dispatch -c -o src/fhsm_crypto.o src/fhsm_crypto.c
cc -Wall -Wextra -Wpedantic -Werror -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wnested-externs -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wstrict-aliasing=2 -Wformat=2 -Wformat-security -Wno-format-nonliteral -Wnull-dereference -Wdouble-promotion -Wconversion -Wno-sign-conversion -Wno-unused-parameter -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -fstack-clash-protection -fcf-protection=full -fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer -DOPENSSL_API_COMPAT=0x30000000L -ffile-prefix-map=/<<PKGBUILDDIR>>= -fdebug-prefix-map=/<<PKGBUILDDIR>>= -frandom-seed=fhsm-1.4.0-FIPS -Wno-builtin-macro-redefined -D__DATE__='"redacted"' -D__TIME__='"redacted"' -g3 -O2 -std=c11 -D_GNU_SOURCE -Iinclude -I/usr/local/ssl/include -Isrc/dispatch -c -o src/fhsm_audit.o src/fhsm_audit.c
cc -Wall -Wextra -Wpedantic -Werror -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wnested-externs -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wstrict-aliasing=2 -Wformat=2 -Wformat-security -Wno-format-nonliteral -Wnull-dereference -Wdouble-promotion -Wconversion -Wno-sign-conversion -Wno-unused-parameter -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -fstack-clash-protection -fcf-protection=full -fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer -DOPENSSL_API_COMPAT=0x30000000L -ffile-prefix-map=/<<PKGBUILDDIR>>= -fdebug-prefix-map=/<<PKGBUILDDIR>>= -frandom-seed=fhsm-1.4.0-FIPS -Wno-builtin-macro-redefined -D__DATE__='"redacted"' -D__TIME__='"redacted"' -g3 -O2 -std=c11 -D_GNU_SOURCE -Iinclude -I/usr/local/ssl/include -Isrc/dispatch -c -o src/fhsm_pkcs11.o src/fhsm_pkcs11.c
src/fhsm_pkcs11.c: In function ‘aes_gmac’:
src/fhsm_pkcs11.c:3964:53: error: ‘%zu’ directive output may be truncated writing between 1 and 20 bytes into a region of size 12 [-Werror=format-truncation=]
 3964 |     snprintf(cipher_name, sizeof(cipher_name), "AES-%zu-GCM", key_len * 8);
      |                                                     ^~~
src/fhsm_pkcs11.c:3964:48: note: directive argument in the range [0, 18446744073709551608]
 3964 |     snprintf(cipher_name, sizeof(cipher_name), "AES-%zu-GCM", key_len * 8);
      |                                                ^~~~~~~~~~~~~
In file included from /usr/include/stdio.h:970,
                 from src/fhsm_pkcs11.c:51:
In function ‘snprintf’,
    inlined from ‘aes_gmac’ at src/fhsm_pkcs11.c:3964:5:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:68:10: note: ‘__builtin___snprintf_chk’ output between 10 and 29 bytes into a destination of size 16
   68 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   69 |                                    __glibc_objsize (__s), __fmt,
      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   70 |                                    __va_arg_pack ());
      |                                    ~~~~~~~~~~~~~~~~~
src/fhsm_pkcs11.c: In function ‘aes_cmac’:
src/fhsm_pkcs11.c:3992:53: error: ‘%zu’ directive output may be truncated writing between 1 and 20 bytes into a region of size 12 [-Werror=format-truncation=]
 3992 |     snprintf(cipher_name, sizeof(cipher_name), "AES-%zu-CBC", key_len * 8);
      |                                                     ^~~
src/fhsm_pkcs11.c:3992:48: note: directive argument in the range [0, 18446744073709551608]
 3992 |     snprintf(cipher_name, sizeof(cipher_name), "AES-%zu-CBC", key_len * 8);
      |                                                ^~~~~~~~~~~~~
In function ‘snprintf’,
    inlined from ‘aes_cmac’ at src/fhsm_pkcs11.c:3992:5:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:68:10: note: ‘__builtin___snprintf_chk’ output between 10 and 29 bytes into a destination of size 16
   68 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   69 |                                    __glibc_objsize (__s), __fmt,
      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   70 |                                    __va_arg_pack ());
      |                                    ~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:155: src/fhsm_pkcs11.o] Error 1
make[2]: Leaving directory '/<<PKGBUILDDIR>>'
make[1]: *** [debian/rules:8: override_dh_auto_build] Error 2
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:4: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess failed with exit status 2
--------------------------------------------------------------------------------

#1144171#10
Date:
2026-08-12 18:49:09 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
freehsm-c, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1144171@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Simon Josefsson <simon@josefsson.org> (supplier of updated freehsm-c package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Wed, 12 Aug 2026 20:28:28 +0200
Source: freehsm-c
Architecture: source
Version: 1.6.0-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Commons <team+debian@tracker.debian.org>
Changed-By: Simon Josefsson <simon@josefsson.org>
Closes: 1144171
Changes:
 freehsm-c (1.6.0-1) unstable; urgency=medium
 .
   * Use compat 14
   * Inject compiler/linker flags (Closes: #1144171)
   * Improve lintian overrides
Checksums-Sha1:
 e6ae4a7bbbf70f21ebb5c938263dc44e04346fff 2201 freehsm-c_1.6.0-1.dsc
 f37382849c2ab1b9057f4c51437e9dd5885f6fe1 4678796 freehsm-c_1.6.0.orig.tar.xz
 aafc7b1cc401121a209cd3e70ef8ded602399e32 3496 freehsm-c_1.6.0-1.debian.tar.xz
 84db34c724e6eb671f4af33b79f8e1ab2e02b510 6808024 freehsm-c_1.6.0-1.git.tar.xz
 34832c985261a0ab50d849fdffcb9750d4d7328c 17560 freehsm-c_1.6.0-1_source.buildinfo
Checksums-Sha256:
 d847777566f13a766279af52070af8cefdc2538f059836f38c7e0a19197b189b 2201 freehsm-c_1.6.0-1.dsc
 a53688e7a70313470b7f5dd9c2eef00e9a80a0d85feae78de50c1d72c669a2d5 4678796 freehsm-c_1.6.0.orig.tar.xz
 269e3f86c622895e2ab535c91fc3ccbd92249f4d940e5286fbec7cb14612bcc4 3496 freehsm-c_1.6.0-1.debian.tar.xz
 bc1e923f1ac4954dd9336c77d7e0f6bb071d975100c5a84d41729d3ea4c63d66 6808024 freehsm-c_1.6.0-1.git.tar.xz
 619756b2d9c943c44bb993ade016b25862ae9f295c426a8cbfefbc8cb6d7ab54 17560 freehsm-c_1.6.0-1_source.buildinfo
Files:
 b7bc6c37bc3fc800b87b0047d538e193 2201 utils optional freehsm-c_1.6.0-1.dsc
 90d79e160958a732ee9cffe0f5230fad 4678796 utils optional freehsm-c_1.6.0.orig.tar.xz
 8c646e945563785181990e65538a074c 3496 utils optional freehsm-c_1.6.0-1.debian.tar.xz
 77d910c2de194f77db0881fd8a26d6f6 6808024 utils None freehsm-c_1.6.0-1.git.tar.xz
 26dfe3cc6dd59e7ff659dfb36759a37b 17560 utils optional freehsm-c_1.6.0-1_source.buildinfo
Git-Tag-Info: tag=c47b48d2b1438b3ac15c8090f20637ed2e20f9f6 fp=a3cc9c870b9d310abad4cf2f51722b08fe4745a2
Git-Tag-Tagger: Simon Josefsson <simon@josefsson.org>
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEN02M5NuW6cvUwJcqYG0ITkaDwHkFAmp8vBIACgkQYG0ITkaD
wHmQFBAAjkO/iKjHbjPW+J7Bl1Nd96MoYQlS2M7M5VdLJQbk/C9UTYoHEFzOBK6d
pj6N+v4ZADW4Op56G8EI+lPEdUJdpVgA5ky0SAT+B/PzCtQ5G9KN5B3ZiEQveVLI
dyhUzTM+fPQVw2AxKTGAT+NgFWo/71NEX13Aa+A167hyc6YnAlM+TmxCyhofTK7J
PSxlcFDHzVKLgv4eQFitvUTcf7jF9OijEQ886a1/NyDPzQswp4fJqLSi4k9a3jiq
zWWPcBn2t/oejQzHrQwSTs5hxKYa8zkJoiKJxTy84RIirt8yiCJuLVsUdHA8/L0y
jFi0AnTYfMPKreJGfwfSFXFVPIqwor5mi3yxpLXYUrYugk4/4K4LTs9AtpjBMdPe
7iuKftiEGIT10vCNi3j+7Q1004QoZhMd3XXiqqGLGL+FLB202/HUDY/ZvhJ5watq
t5XEdwmy7WyqyFoyePWPp2eUKdhS8/dT5jE7q1vHjRrDJYmDFEfl69RsNGiprEvZ
dIP38lRWIS0CeiHj4M61IbnkkI3TqWpAvMPbQ9f/ERYyDTq6Adg+bwp+f4kHxAZz
zHpJU49q7P1bTKwkfmdQpEEU8LPTZ7xOPAsNGEiXKbCJahzkOSud8PHowrOiMX26
XJpBBKBd8Uw5CM16+9Fw2jlDe/gVxrtCO2eRIyegniN3Nc0rHbo=
=xIgv
-----END PGP SIGNATURE-----