Debian Bug report logs -
#8093
nn dumps core if NNTPSERVER is invalid
Reported by: Richard Braakman <dark@xs4all.nl>
Date: Sun, 16 Mar 1997 05:18:01 UTC
Severity: normal
Found in version 6.5.0.b3.linux.1.1-01
Bug is archived. No further changes may be made.
Toggle useless messages
Report forwarded to debian-bugs-dist@lists.debian.org, Mike Coleman <coleman@chez-gnu.cstp.umkc.edu>
:
Bug#8093
; Package nn
.
(full text, mbox, link).
Acknowledgement sent to Richard Braakman <dark@xs4all.nl>
:
New bug report received and forwarded. Copy sent to Mike Coleman <coleman@chez-gnu.cstp.umkc.edu>
.
(full text, mbox, link).
Message #5 received at bugs@bugs.debian.org (full text, mbox, reply):
Package: nn
Version: 6.5.0.b3.linux.1.1-01
When I start nn while the environment variable NNTPSERVER cannot be
found by gethostbyname(), it dumps core immediately. I have traced
the problem to the function nntp_check() in nntp.c. I quote it here.
The problem line has been marked with an arrow in the left margin.
/*
* nntp_check: Find out whether we need to use NNTP.
*
* This is done by comparing the NNTP servers name with whatever
* nn_gethostname() returns.
* use_nntp and news_active are initialised as a side effect.
*/
nntp_check()
{
char host[128];
const char *server_real_name;
if (nntp_local_server) return;
find_server();
nn_gethostname(host, sizeof host);
strncpy(host, (gethostbyname(host))->h_name, sizeof host);
--> server_real_name = (gethostbyname(nntp_server))->h_name;
use_nntp = (strcmp(host, server_real_name) != 0);
if (use_nntp) {
freeobj(news_active);
#ifndef NOV
news_active = mk_file_name(db_directory, "ACTIVE");
#else /* NOV */
news_active = mk_file_name(nn_directory, "ACTIVE");
#endif /* NOV */
}
}
The function gethostbyname() will return 0 if the lookup fails for any
reason. The subsequent dereference will cause the program to dump
core.
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Fri May 3 18:00:37 2024;
Machine Name:
buxtehude
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.