Report forwarded to debian-bugs-dist@lists.debian.org, Mike Coleman <coleman@chez-gnu.cstp.umkc.edu>:
Bug#8093; Package nn.   debian-bugs-dist@lists.debian.orgMike Coleman  Subject: Bug#8093: nn dumps core if NNTPSERVER is invalid Reply-To: Richard Braakman , 8093@bugs.debian.org Resent-From: Richard Braakman Resent-To: debian-bugs-dist@lists.debian.org Resent-CC: Mike Coleman Resent-Date: Sun, 16 Mar 1997 05:18:01 GMT Resent-Message-ID: Resent-Sender: iwj@debian.org X-Debian-PR-Package: nn X-Debian-PR-Keywords: X-Loop: owner@bugs.debian.org Received: via spool by bugs@bugs.debian.org id=B.85848932621517 (code B ref -1); Sun, 16 Mar 1997 05:18:01 GMT From: Richard Braakman Message-Id: <199703160506.GAA04489@xs1.xs4all.nl> To: bugs@bugs.debian.org Date: Sun, 16 Mar 1997 06:06:08 +0100 (MET) X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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.   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>.   -t  From: owner@bugs.debian.org (Ian Jackson) To: Richard Braakman Subject: Bug#8093: Acknowledgement (was: nn dumps core if NNTPSERVER is invalid) Message-ID: In-Reply-To: <199703160506.GAA04489@xs1.xs4all.nl> References: <199703160506.GAA04489@xs1.xs4all.nl> Thank you for the problem report you have sent regarding Debian Linux. This is an automatically generated reply, to let you know your message has been received. It is being forwarded to the developers' mailing list for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): Mike Coleman If you wish to submit further information on your problem, please send it to 8093@bugs.debian.org (and *not* to bugs@bugs.debian.org). Please do not reply to the address at the top of this message, unless you wish to report a problem with the bug-tracking system. Ian Jackson (maintainer, Debian bug tracking system)   Received: (at bugs) by bugs.debian.org; 16 Mar 1997 05:15:26 +0000 Received: (qmail 21515 invoked from network); 16 Mar 1997 05:15:25 -0000 Received: from smtp1.xs4all.nl (194.109.6.51) by master.debian.org with SMTP; 16 Mar 1997 05:15:24 -0000 Received: from magigimmix.xs4all.nl (magigimmix.xs4all.nl [194.109.6.25]) by smtp1.xs4all.nl (8.7.6/XS4ALL) with ESMTP id GAA20434 for ; Sun, 16 Mar 1997 06:06:09 +0100 (MET) Received: from xs1.xs4all.nl (xs1.xs4all.nl [194.109.6.42]) by magigimmix.xs4all.nl (8.7.6/XS4ALL) with ESMTP id GAA09357 for ; Sun, 16 Mar 1997 06:06:08 +0100 (MET) Received: (from dark@localhost) by xs1.xs4all.nl (8.7.6/XS4ALL) id GAA04489 for bugs@bugs.debian.org; Sun, 16 Mar 1997 06:06:08 +0100 (MET) From: Richard Braakman Message-Id: <199703160506.GAA04489@xs1.xs4all.nl> Subject: nn dumps core if NNTPSERVER is invalid To: bugs@bugs.debian.org Date: Sun, 16 Mar 1997 06:06:08 +0100 (MET) X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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.