* Re: master e90a457c46: * src/xrdb.c (main) [TESTRM]: Replace gets with fgets.
[not found] ` <20220908104901.EC7E5C04F0B@vcs2.savannah.gnu.org>
@ 2022-09-08 12:21 ` Robert Pluim
2022-09-09 2:00 ` Stefan Kangas
2022-09-08 13:31 ` Po Lu
1 sibling, 1 reply; 4+ messages in thread
From: Robert Pluim @ 2022-09-08 12:21 UTC (permalink / raw)
To: emacs-devel; +Cc: Stefan Kangas
>>>>> On Thu, 8 Sep 2022 06:49:01 -0400 (EDT), Stefan Kangas <stefankangas@gmail.com> said:
Stefan> branch: master
Stefan> commit e90a457c46ca9463bf77cab2d34513c45269c938
Stefan> Author: Stefan Kangas <stefankangas@gmail.com>
Stefan> Commit: Stefan Kangas <stefankangas@gmail.com>
Stefan> * src/xrdb.c (main) [TESTRM]: Replace gets with fgets.
Stefan> ---
Stefan> src/xrdb.c | 4 ++--
Stefan> 1 file changed, 2 insertions(+), 2 deletions(-)
To be 100% PSIRT compliant you should check the return value of fgets
as well 😺
Robert
--
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: master e90a457c46: * src/xrdb.c (main) [TESTRM]: Replace gets with fgets.
[not found] ` <20220908104901.EC7E5C04F0B@vcs2.savannah.gnu.org>
2022-09-08 12:21 ` master e90a457c46: * src/xrdb.c (main) [TESTRM]: Replace gets with fgets Robert Pluim
@ 2022-09-08 13:31 ` Po Lu
2022-09-08 21:10 ` Stefan Kangas
1 sibling, 1 reply; 4+ messages in thread
From: Po Lu @ 2022-09-08 13:31 UTC (permalink / raw)
To: emacs-devel; +Cc: Stefan Kangas
Stefan Kangas <stefankangas@gmail.com> writes:
> branch: master
> commit e90a457c46ca9463bf77cab2d34513c45269c938
> Author: Stefan Kangas <stefankangas@gmail.com>
> Commit: Stefan Kangas <stefankangas@gmail.com>
>
> * src/xrdb.c (main) [TESTRM]: Replace gets with fgets.
> ---
> src/xrdb.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/xrdb.c b/src/xrdb.c
> index faeea04a53..5ff25dde14 100644
> --- a/src/xrdb.c
> +++ b/src/xrdb.c
> @@ -589,14 +589,14 @@ main (int argc, char **argv)
> char query_class[90];
>
> printf ("Name: ");
> - gets (query_name);
> + fgets (query_name, 90, stdin);
>
> if (strlen (query_name))
> {
> char *value;
>
> printf ("Class: ");
> - gets (query_class);
> + fgets (query_class, 90, stdin);
>
> value = x_get_string_resource (&xdb, query_name, query_class);
>
TESTRM has not worked for a long time and relies on XLIB_ILLEGAL_ACCESS,
which is not okay to use anymore.
I would rather it be removed.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: master e90a457c46: * src/xrdb.c (main) [TESTRM]: Replace gets with fgets.
2022-09-08 13:31 ` Po Lu
@ 2022-09-08 21:10 ` Stefan Kangas
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Kangas @ 2022-09-08 21:10 UTC (permalink / raw)
To: Po Lu; +Cc: Emacs developers
Po Lu <luangruo@yahoo.com> writes:
> TESTRM has not worked for a long time and relies on XLIB_ILLEGAL_ACCESS,
> which is not okay to use anymore.
>
> I would rather it be removed.
Makes sense to me.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: master e90a457c46: * src/xrdb.c (main) [TESTRM]: Replace gets with fgets.
2022-09-08 12:21 ` master e90a457c46: * src/xrdb.c (main) [TESTRM]: Replace gets with fgets Robert Pluim
@ 2022-09-09 2:00 ` Stefan Kangas
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Kangas @ 2022-09-09 2:00 UTC (permalink / raw)
To: Robert Pluim; +Cc: emacs-devel
Robert Pluim <rpluim@gmail.com> writes:
> To be 100% PSIRT compliant you should check the return value of fgets
> as well 😺
;-)
(Also, "gets" has been removed in C11.)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-09-09 2:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <166263414162.19351.12274380239965486683@vcs2.savannah.gnu.org>
[not found] ` <20220908104901.EC7E5C04F0B@vcs2.savannah.gnu.org>
2022-09-08 12:21 ` master e90a457c46: * src/xrdb.c (main) [TESTRM]: Replace gets with fgets Robert Pluim
2022-09-09 2:00 ` Stefan Kangas
2022-09-08 13:31 ` Po Lu
2022-09-08 21:10 ` Stefan Kangas
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).