Re: [PATCH gnupg] Fix gcc -Wunterminated-string-initialization warnings.

Collin Funk via Gnupg-devel <[email protected]>
Newsgroups gmane.comp.encryption.gpg.devel
Message-ID <[email protected]>
Hi Werner,

Werner Koch <[email protected]> writes:

> On Tue, 29 Apr 2025 21:01, Collin Funk said:
>> (has_only_base64): Use memchr since calling strchr on a non-NUL
>> terminated string is undefined behavior.
>
> Very good catch.  I was my fault 22 years ago:
> [...]
> Thanks for the patch.  I am going to apply this to all branches.

Thanks! It was the first time I was alerted to a bug by this new GCC 15
warning. The other cases I saw in Gnulib and Emacs were harmless.

> Regarding the nonstring attribute we need to wait that we can make
> libgpg-error 1.55 a requirement.  That version provides the
> GPGRT_ATTR_NONSTRING.  For master we might soon make this a dependency
> but not for the other branches.

Sure, I saw that macro was recently added which was why my patch used
internal macros. But if you prefer to not duplicate the GCC version
checks and such that is fine by me.

Collin

_______________________________________________
Gnupg-devel mailing list
[email protected]
https://lists.gnupg.org/mailman/listinfo/gnupg-devel
signature.asc (application/pgp-signature, 832 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEI3EYVQjRMXvVeOXMjOZJGuMNfXUFAmgSVAcACgkQjOZJGuMN
fXVGGQ//TkPT4gJGA+9DJIH75MhIm7N3nTfWy63Jx/sLNpDh6Lfqp3SVYXqnD2eJ
LuiRvDRtcmSoS/N8psS/iCHJZrLjrojslr4pbfwVIS7Jkhxuv3t66y0NgwUMRx0w
RxLXV2ZIYIFBUC9VdzsGX4oqXI8RqvTjlx7jZ/wz7+Yi22c69JpuU8wuU6qffULi
l9sfFtkJDdw+y09ynv0DSkkx2U6gspQwDa8NDdqFHRUR8HgVsr+UZrCca3CVxLEN
BeXVmq9n2M/ra6sAGqXcU2wu8v4iqHjnV9gl51pvRrP3hG0KLXLza0fPDbmNZ+FW
dJYMcgMQemGnO44Wc1wqUg0wlzF9faiIDpeFIN1hSxXI0aiTOpVirDpsknt9msfy
lIOk6EDAhQ2dpsOmYQN1p/g7qW0CvTClX4S6ll7IvID/TP9gZby5/fiFTHfQvQ9K
YjYT3GarvLB5BfCQtj3bz3N9wqvp3Y1+oVc2vHzCMwA65HbXrC1nBzhyPdtpmqxI
sfvB+2HA8SRl9VI98+mZbIAfVL9x3ZpN6VxuBVXf1OLYwlg2BujX6U/Zab6Mn1mA
NtUjf3gXXlGCRp3QbnsPGDcrE2UV9ebk+DYD+GvsyuPAcj6yiW4CtOxJvuN3qTrZ
sJzsg//AFhyrz0L+79H28VUnRVATs320oudkcdEJEWt7zNErCp0=
=5RMU
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.