bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#50155: don't use the conversion specifier %n in emacsclient


From: Omar Polo
Subject: bug#50155: don't use the conversion specifier %n in emacsclient
Date: Sat, 21 Aug 2021 23:38:04 +0200

Tags: patch

Hello,

The usage of the %n conversion specifier for printf(3) is widely
discouraged (see [0] for instance).  The OpenBSD libc in particular
logs to syslog every time an application tries to use %n.

Now, in this specific case it's used in a completely safe manner, but
avoiding it seems pretty easy.

Another option would be

        char *emacsdirend = strchr(sockname + tmpdirlen + 1, '/');

but I'm not sure it would be cleaner.

Thanks,

Omar Polo

[0]: https://man.bsd.lv/Linux-5.06/printf.3#BUGS



In GNU Emacs 28.0.50 (build 11, x86_64-unknown-openbsd6.9, X toolkit, cairo 
version 1.16.0, Xaw scroll bars)
 of 2021-08-17 built on venera
Windowing system distributor 'The X.Org Foundation', version 11.0.12010000
System Description: OpenBSD venera 6.9 GENERIC.MP#158 amd64

Configured using:
 'configure --prefix=/home/op/opt/emacs --with-x-toolkit=lucid CC=cc'

Attachment: 0001-don-t-use-n.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]