Tuesday, September 07, 2021

Warnings for %n in format strings

Earlier today, semarie@ committed a change that will now cause base
clang to warn when the %n specifier appears in a format string for
the printf(3) family of functions:

warning: '%n' format specifier support is deactivated and will call abort(3)

I already ran a full amd64 bulk build with this. The surprisingly
short list of ports that produce the warning is below.

THIS NEEDS TO BE FIXED.

databases/openldap23 The OpenBSD ports mailing-list <ports@openbsd.org>
devel/adb The OpenBSD ports mailing-list <ports@openbsd.org>
devel/libvstr The OpenBSD ports mailing-list <ports@openbsd.org>
editors/cooledit Marc Espie <espie@openbsd.org>
editors/nedit Alessandro De Laurenzis <just22@atlantide.mooo.com>
games/gnugo The OpenBSD ports mailing-list <ports@openbsd.org>
games/xmahjongg The OpenBSD ports mailing-list <ports@openbsd.org>
lang/ghc The OpenBSD ports mailing-list <ports@openbsd.org>
lang/node Volker Schlecht <openbsd-ports@schlecht.dev>
mail/exim Renaud Allard <renaud@allard.it>
math/mcl The OpenBSD ports mailing-list <ports@openbsd.org>
math/yorick The OpenBSD ports mailing-list <ports@openbsd.org>
misc/brltty The OpenBSD ports mailing-list <ports@openbsd.org>
misc/uniutils Nicholas Marriott <nicm@openbsd.org>
net/climm Pascal Stumpf <pascal@stumpf.co>
net/dnstracer The OpenBSD ports mailing-list <ports@openbsd.org>
net/libsmi Nigel Taylor <nigel@openbsd.org>
print/lcdf-typetools The OpenBSD ports mailing-list <ports@openbsd.org>
security/gnupg Edd Barrett <edd@openbsd.org>
security/libssh2 Benoit Lecocq <benoit@openbsd.org>
security/openssl/1.1 The OpenBSD ports mailing-list <ports@openbsd.org>
security/openssl/3.0 The OpenBSD ports mailing-list <ports@openbsd.org>
security/sslscan Stuart Henderson <stu.ports@spacehopper.org>
sysutils/cdrtools The OpenBSD ports mailing-list <ports@openbsd.org>
textproc/link-grammar The OpenBSD ports mailing-list <ports@openbsd.org>
textproc/openjade The OpenBSD ports mailing-list <ports@openbsd.org>
x11/fvwm2 Michael <michi+openbsd@dataswamp.org>

The raw grep over the build logs:

./databases/openldap23.log:/usr/obj/ports/openldap-server-2.3.43/openldap-2.3.43/libraries/libldap/url.c:620:34: warning: '%n' format specifier support is deactivated and will call abort(3)
./databases/openldap23.log:/usr/obj/ports/openldap-server-2.3.43/openldap-2.3.43/libraries/libldap/url.c:625:29: warning: '%n' format specifier support is deactivated and will call abort(3)
./databases/openldap23.log:/usr/obj/ports/openldap-server-2.3.43/openldap-2.3.43/libraries/libldap/url.c:620:34: warning: '%n' format specifier support is deactivated and will call abort(3)
./databases/openldap23.log:/usr/obj/ports/openldap-server-2.3.43/openldap-2.3.43/libraries/libldap/url.c:625:29: warning: '%n' format specifier support is deactivated and will call abort(3)
./databases/openldap23.log:url.c:620:34: warning: '%n' format specifier support is deactivated and will call abort(3)
./databases/openldap23.log:url.c:625:29: warning: '%n' format specifier support is deactivated and will call abort(3)
./databases/openldap23.log:url.c:620:34: warning: '%n' format specifier support is deactivated and will call abort(3)
./databases/openldap23.log:url.c:625:29: warning: '%n' format specifier support is deactivated and will call abort(3)
./devel/adb.log:transport.c:919:41: warning: '%n' format specifier support is deactivated and will call abort(3)
./devel/libvstr.log:/usr/obj/ports/vstr-1.0.15/vstr-1.0.15/src/vstr_sc.c:514:39: warning: '%n' format specifier support is deactivated and will call abort(3)
./devel/libvstr.log:/usr/obj/ports/vstr-1.0.15/vstr-1.0.15/src/vstr_sc.c:571:40: warning: '%n' format specifier support is deactivated and will call abort(3)
./devel/libvstr.log:/usr/obj/ports/vstr-1.0.15/vstr-1.0.15/src/vstr_sc.c:917:40: warning: '%n' format specifier support is deactivated and will call abort(3)
./devel/libvstr.log:/usr/obj/ports/vstr-1.0.15/vstr-1.0.15/src/vstr_sc.c:514:39: warning: '%n' format specifier support is deactivated and will call abort(3)
./devel/libvstr.log:/usr/obj/ports/vstr-1.0.15/vstr-1.0.15/src/vstr_sc.c:571:40: warning: '%n' format specifier support is deactivated and will call abort(3)
./devel/libvstr.log:/usr/obj/ports/vstr-1.0.15/vstr-1.0.15/src/vstr_sc.c:917:40: warning: '%n' format specifier support is deactivated and will call abort(3)
./lang/node.log:../deps/openssl/openssl/apps/rehash.c:407:53: warning: '%n' format specifier support is deactivated and will call abort(3)
./lang/node.log:../deps/openssl/openssl/apps/rehash.c:429:53: warning: '%n' format specifier support is deactivated and will call abort(3)
./lang/ghc.log: warning: '%n' format specifier support is deactivated and will call abort(3)
./lang/ghc.log: warning: '%n' format specifier support is deactivated and will call abort(3)
./lang/ghc.log: warning: '%n' format specifier support is deactivated and will call abort(3)
./lang/ghc.log: warning: '%n' format specifier support is deactivated and will call abort(3)
./lang/ghc.log: warning: '%n' format specifier support is deactivated and will call abort(3)
./lang/ghc.log: warning: '%n' format specifier support is deactivated and will call abort(3)
./lang/ghc.log: warning: '%n' format specifier support is deactivated and will call abort(3)
./lang/ghc.log: warning: '%n' format specifier support is deactivated and will call abort(3)
./textproc/link-grammar,-java.log:command-line.c:446:17: warning: '%n' format specifier support is deactivated and will call abort(3)
./textproc/link-grammar,-java.log:command-line.c:644:39: warning: '%n' format specifier support is deactivated and will call abort(3)
./textproc/openjade.log:TeXFOTBuilder.cxx:1007:27: warning: '%n' format specifier support is deactivated and will call abort(3)
./textproc/openjade.log:MifFOTBuilder.cxx:1203:33: warning: '%n' format specifier support is deactivated and will call abort(3)
./security/libssh2.log:subsystem_netconf.c:267:17: warning: '%n' format specifier support is deactivated and will call abort(3)
./security/libssh2.log:subsystem_netconf.c:285:17: warning: '%n' format specifier support is deactivated and will call abort(3)
./security/gnupg.log:keylist.c:258:43: warning: '%n' format specifier support is deactivated and will call abort(3)
./security/gnupg.log:protect.c:570:37: warning: '%n' format specifier support is deactivated and will call abort(3)
./security/gnupg.log:protect.c:570:56: warning: '%n' format specifier support is deactivated and will call abort(3)
./security/gnupg.log:protect.c:570:65: warning: '%n' format specifier support is deactivated and will call abort(3)
./security/gnupg.log:protect.c:570:37: warning: '%n' format specifier support is deactivated and will call abort(3)
./security/gnupg.log:protect.c:570:56: warning: '%n' format specifier support is deactivated and will call abort(3)
./security/gnupg.log:protect.c:570:65: warning: '%n' format specifier support is deactivated and will call abort(3)
./security/gnupg.log:protect.c:570:37: warning: '%n' format specifier support is deactivated and will call abort(3)
./security/gnupg.log:protect.c:570:56: warning: '%n' format specifier support is deactivated and will call abort(3)
./security/gnupg.log:protect.c:570:65: warning: '%n' format specifier support is deactivated and will call abort(3)
./security/sslscan.log:apps/rehash.c:407:53: warning: '%n' format specifier support is deactivated and will call abort(3)
./security/sslscan.log:apps/rehash.c:429:53: warning: '%n' format specifier support is deactivated and will call abort(3)
./security/openssl/3.0.log:apps/rehash.c:419:53: warning: '%n' format specifier support is deactivated and will call abort(3)
./security/openssl/3.0.log:apps/rehash.c:441:53: warning: '%n' format specifier support is deactivated and will call abort(3)
./security/openssl/1.1.log:apps/rehash.c:407:53: warning: '%n' format specifier support is deactivated and will call abort(3)
./security/openssl/1.1.log:apps/rehash.c:429:53: warning: '%n' format specifier support is deactivated and will call abort(3)
./x11/fvwm2.log:/usr/obj/ports/fvwm2-2.6.9/fvwm-2.6.9/libs/ColorUtils.c:409:32: warning: '%n' format specifier support is deactivated and will call abort(3)
./x11/fvwm2.log:/usr/obj/ports/fvwm2-2.6.9/fvwm-2.6.9/libs/ColorUtils.c:415:27: warning: '%n' format specifier support is deactivated and will call abort(3)
./x11/fvwm2.log:/usr/obj/ports/fvwm2-2.6.9/fvwm-2.6.9/libs/Module.c:500:22: warning: '%n' format specifier support is deactivated and will call abort(3)
./x11/fvwm2.log:/usr/obj/ports/fvwm2-2.6.9/fvwm-2.6.9/libs/Module.c:515:23: warning: '%n' format specifier support is deactivated and will call abort(3)
./net/libsmi.log:smidump.c:236:37: warning: '%n' format specifier support is deactivated and will call abort(3)
./net/climm.log:io/io_socks5.c:181:39: warning: '%n' format specifier support is deactivated and will call abort(3)
./net/climm.log:io/io_socks5.c:234:57: warning: '%n' format specifier support is deactivated and will call abort(3)
./net/climm.log:io/io_socks5.c:238:57: warning: '%n' format specifier support is deactivated and will call abort(3)
./net/climm.log:io/io_socks5.c:245:53: warning: '%n' format specifier support is deactivated and will call abort(3)
./net/climm.log:io/io_socks5.c:249:57: warning: '%n' format specifier support is deactivated and will call abort(3)
./net/dnstracer.log:dnstracer.c:1017:18: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/cooledit.log:editoptions.c:381:43: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/cooledit.log:editoptions.c:385:37: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/cooledit.log:editoptions.c:389:31: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/cooledit.log:options.c:408:29: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/cooledit.log:options.c:414:31: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/cooledit.log:options.c:416:29: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/cooledit.log:options.c:421:29: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/cooledit.log:options.c:423:29: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/cooledit.log:shell.c:931:52: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/cooledit,python.log:editoptions.c:381:43: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/cooledit,python.log:editoptions.c:385:37: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/cooledit,python.log:editoptions.c:389:31: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/cooledit,python.log:options.c:408:29: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/cooledit,python.log:options.c:414:31: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/cooledit,python.log:options.c:416:29: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/cooledit,python.log:options.c:421:29: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/cooledit,python.log:options.c:423:29: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/cooledit,python.log:shell.c:931:52: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/nedit.log:misc.c:1491:23: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/nedit.log:misc.c:1495:20: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/nedit.log:misc.c:1500:28: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/nedit.log:misc.c:1502:28: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/nedit.log:misc.c:1507:28: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/nedit.log:misc.c:1509:28: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/nedit.log:nc.c:781:60: warning: '%n' format specifier support is deactivated and will call abort(3)
./editors/nedit.log:nc.c:819:49: warning: '%n' format specifier support is deactivated and will call abort(3)
./games/gnugo.log:readconnect.c:1882:39: warning: '%n' format specifier support is deactivated and will call abort(3)
./games/gnugo.log:readconnect.c:1885:32: warning: '%n' format specifier support is deactivated and will call abort(3)
./games/gnugo.log:readconnect.c:2583:46: warning: '%n' format specifier support is deactivated and will call abort(3)
./games/gnugo.log:readconnect.c:2587:35: warning: '%n' format specifier support is deactivated and will call abort(3)
./games/gnugo.log:readconnect.c:2593:33: warning: '%n' format specifier support is deactivated and will call abort(3)
./games/gnugo.log:reading.c:5063:37: warning: '%n' format specifier support is deactivated and will call abort(3)
./games/gnugo.log:reading.c:5066:30: warning: '%n' format specifier support is deactivated and will call abort(3)
./games/xmahjongg.log:permstr.cc:312:28: warning: '%n' format specifier support is deactivated and will call abort(3)
./mail/exim,-eximon.log:acl.c:2910:38: warning: '%n' format specifier support is deactivated and will call abort(3)
./mail/exim,ldap,-eximon.log:acl.c:2910:38: warning: '%n' format specifier support is deactivated and will call abort(3)
./mail/exim,ldap,mysql,postgresql,-main.log:acl.c:2910:38: warning: '%n' format specifier support is deactivated and will call abort(3)
./mail/exim,mysql,-main.log:acl.c:2910:38: warning: '%n' format specifier support is deactivated and will call abort(3)
./mail/exim,postgresql,-main.log:acl.c:2910:38: warning: '%n' format specifier support is deactivated and will call abort(3)
./print/lcdf-typetools.log:permstr.cc:278:28: warning: '%n' format specifier support is deactivated and will call abort(3)
./math/mcl.log:io.c:1416:27: warning: '%n' format specifier support is deactivated and will call abort(3)
./math/mcl.log:io.c:1419:32: warning: '%n' format specifier support is deactivated and will call abort(3)
./math/mcl.log:io.c:1431:27: warning: '%n' format specifier support is deactivated and will call abort(3)
./math/mcl.log:io.c:1440:31: warning: '%n' format specifier support is deactivated and will call abort(3)
./math/yorick.log:fonts.c:103:24: warning: '%n' format specifier support is deactivated and will call abort(3)
./misc/uniutils.log:ExplicateUTF8.c:217:55: warning: '%n' format specifier support is deactivated and will call abort(3)
./misc/brltty.log:/usr/obj/ports/brltty-3.6/brltty-3.6/Programs/cmd.c:90:34: warning: '%n' format specifier support is deactivated and will call abort(3)
./sysutils/cdrtools.log:cdr_drv.c:286:13: warning: '%n' format specifier support is deactivated and will call abort(3)

--
Christian "naddy" Weisgerber naddy@mips.inka.de

No comments:

Post a Comment