pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/news/nn patch-bd: Address a null pointer deference tha...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b7f2ada35c1c
branches:  trunk
changeset: 478170:b7f2ada35c1c
user:      rumble <rumble%pkgsrc.org@localhost>
date:      Mon Jul 19 01:19:41 2004 +0000

description:
patch-bd: Address a null pointer deference that occurs when
gethostbyname(3) cannot resolve the local host returned by
gethostname(3).

diffstat:

 news/nn/distinfo         |   3 ++-
 news/nn/patches/patch-bd |  13 +++++++++++++
 2 files changed, 15 insertions(+), 1 deletions(-)

diffs (31 lines):

diff -r 86a5e8a109f5 -r b7f2ada35c1c news/nn/distinfo
--- a/news/nn/distinfo  Mon Jul 19 00:08:41 2004 +0000
+++ b/news/nn/distinfo  Mon Jul 19 01:19:41 2004 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.4 2004/05/03 12:56:10 kim Exp $
+$NetBSD: distinfo,v 1.5 2004/07/19 01:19:41 rumble Exp $
 
 SHA1 (nn-6.6.4.tar.gz) = 9e89a1b93b4315d3ed484bf87495f357bb9cc7b4
 Size (nn-6.6.4.tar.gz) = 581672 bytes
@@ -30,3 +30,4 @@
 SHA1 (patch-ba) = bbc9cbec0d191be082b1f211d146916e07100d43
 SHA1 (patch-bb) = af094b78b3f2fc0cdb77dea834d74a35fbb170a4
 SHA1 (patch-bc) = 981b2abf745d41f82e1dd4b77981457a5f19591c
+SHA1 (patch-bd) = a1f2fc2e3009b26d6d19760ce837ce257e1112a1
diff -r 86a5e8a109f5 -r b7f2ada35c1c news/nn/patches/patch-bd
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/news/nn/patches/patch-bd  Mon Jul 19 01:19:41 2004 +0000
@@ -0,0 +1,13 @@
+--- nntp.c.old 2004-07-18 15:16:03.000000000 -0400
++++ nntp.c     2004-07-18 15:16:07.000000000 -0400
+@@ -837,7 +837,9 @@
+     if (nntp_local_server) return;
+ 
+     find_server();
+-    strncpy(host_name, (gethostbyname(host_name))->h_name, sizeof host_name);
++
++    if ((hp = gethostbyname(host_name)) != NULL)
++      strncpy(host_name, hp->h_name, sizeof host_name);
+ 
+     if ((hp = gethostbyname(nntp_server)) != NULL)
+       server_real_name = hp->h_name;



Home | Main Index | Thread Index | Old Index