🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
3 messages
3 total messages Started by Richard P. Bainter Thu, 17 Mar 1994 16:31
Trn/INN bombing out during 'XHDR xref'...
#2468
Author: Richard P. Bainter
Date: Thu, 17 Mar 1994 16:31
60 lines
3172 bytes
Good Morning,

   Well I looked though the old messages and the FAQs. I found no
   reference to this, so here I am. The following problem just started
   occuring this morning.

   When reading a newsgroup, (I've only found one so far) trn starts
   displaying the headers (in '+' mode) and gets to a certain point then
   dies simply displaying '595 (none)'. I've looked at this messsage. 
   It appears as any other message in the directory does. The end of the 
   trace is included at the bottom.

   Has anyone seen this before, know a solution or know where to try and
   find the problem? If I telnet to the port, I can list the message
   just fine. I get '595 (none)' if I do a 'XHDR xref', but I get it on lots
   of other messages that work as well.

   Thanks for any and all help.

Ciao,

----
write (5, "XHDR xref 583-587\r\n", 19) = 19
read (3, "221 xref fields follow\r\n583 (non".., 4096) = 87
ioctl (0, 0x4004667f, 0x59a08) = 0
ioctl (0, 0x4004667f, 0x59a08) = 0
ioctl (0, 0x4004667f, 0x59a08) = 0
ioctl (0, 0x4004667f, 0x59a08) = 0
ioctl (0, 0x4004667f, 0x59a08) = 0
write (5, "XHDR xref 588-592\r\n", 19) = 19
read (3, "221 xref fields follow\r\n588 (non".., 4096) = 131
ioctl (0, 0x4004667f, 0x59a08) = 0
ioctl (0, 0x4004667f, 0x59a08) = 0
ioctl (0, 0x4004667f, 0x59a08) = 0
ioctl (0, 0x4004667f, 0x59a08) = 0
ioctl (0, 0x4004667f, 0x59a08) = 0
write (5, "XHDR xref 593-597\r\n", 19) = 19
read (3, "221 xref fields follow\r\n593 (non".., 4096) = 616
ioctl (0, 0x4004667f, 0x59a08) = 0
ioctl (0, 0x4004667f, 0x59a08) = 0
ioctl (0, 0x4004667f, 0x59a08) = 0
ioctl (0, 0x4004667f, 0x59a08) = 0
ioctl (0, 0x4004667f, 0x59a08) = 0
write (5, "XHDR xref 598-602\r\n", 19) = 19
write (2, "\n595 (none)\n", 12) = 
595 (none)
12
ioctl (2, 0x80067409, 0x5d6e0) = 0
unlink ("/home/pug/.rnlock") = 0
unlink ("rrn.15814") = -1 ENOENT (No such file or directory)
unlink ("/tmp/rrnact.15814") = 0
write (5, "QUIT\r\n", 6) = 6
----

-- 
Richard Bainter          Mundanely     |    System Analyst        - OMG/CSD
Pug                      Generally     |    Applied Research Labs - U.Texas
          pug@arlut.utexas.edu         |    pug@wixer.cactus.org
Note: The views may not reflect my employers, or even my own for that matter.
Re: Trn/INN bombing out during 'XHDR xref'...
#2467
Author: Richard P. Bainter
Date: Thu, 17 Mar 1994 19:14
47 lines
2975 bytes
Good Morning,

  Well it appears that the problem has been solved. It seems to be a
  buffer overflow in trn, although I haven't had a chance to test the
  patch for it yet. I don't see any reason why it wouldn't work.

  Thanks to everyone. Especially 'davison@borland.com (Wayne Davison)'.

  Btw, the message in question is:
  
  <2m9juh$1on@nz12.rz.uni-karlsruhe.de>

  cross posted to:

  comp.edu comp.lang.basic.visual comp.lang.c comp.lang.c++ 
  comp.lang.fortran comp.lang.misc comp.lang.pascal comp.lang.smalltalk 
  comp.lang.tcl comp.multimedia comp.software-eng comp.unix.misc
  sci.agriculture sci.anthropology sci.archaeology sci.astro sci.bio 
  sci.chem sci.classics sci.comp-aided sci.econ sci.edu sci.electronics 
  sci.math sci.med sci.misc sci.philosophy.tech sci.physics sci.psychology
  sci.research

  The original message follows.

Ciao,

In article <2ma0l2$fo4@ns1.arlut.utexas.edu>,
Richard P. Bainter <pug@arlut.utexas.edu> wrote:
>   Well I looked though the old messages and the FAQs. I found no
>   reference to this, so here I am. The following problem just started
>   occuring this morning.
>
>   When reading a newsgroup, (I've only found one so far) trn starts
>   displaying the headers (in '+' mode) and gets to a certain point then
>   dies simply displaying '595 (none)'. I've looked at this messsage. 
>   It appears as any other message in the directory does. The end of the 
>   trace is included at the bottom.
>
>   Has anyone seen this before, know a solution or know where to try and
>   find the problem? If I telnet to the port, I can list the message
>   just fine. I get '595 (none)' if I do a 'XHDR xref', but I get it on lots
>   of other messages that work as well.
-- 
Richard Bainter          Mundanely     |    System Analyst        - OMG/CSD
Pug                      Generally     |    Applied Research Labs - U.Texas
          pug@arlut.utexas.edu         |    pug@wixer.cactus.org
Note: The views may not reflect my employers, or even my own for that matter.
Re: Trn/INN bombing out during 'XHDR xref'...
#2469
Author: Wayne Davison
Date: Thu, 17 Mar 1994 22:53
51 lines
2693 bytes
According to Richard P. Bainter <pug@arlut.utexas.edu>:
>   Well it appears that the problem has been solved. It seems to be a
>   buffer overflow in trn, although I haven't had a chance to test the
>   patch for it yet. I don't see any reason why it wouldn't work.

Richard has since gotten back to me that the patch does indeed work.  I'll
include it here in case anyone else in running into this same problem.  The
line numbers below will be off by a few lines, but don't worry about that.
See the end of the INSTALL file if you run into trouble applying this patch.
-- 
Wayne Davison
davison@borland.com
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Index:head.c
@@ -378,18 +382,22 @@
 	nntp_command(ser_line);
 	if (nntp_check(TRUE) == NNTP_CLASS_OK) {
+	    char *line, *last_buf = ser_line;
+	    MEM_SIZE last_buflen = sizeof ser_line;
 	    for (ap = find_article(artnum); ; ) {
-		nntp_gets(ser_line, sizeof ser_line);
+		line = nntp_get_a_line(last_buf, last_buflen);
 # ifdef DEBUG
 		if (debug & DEB_NNTP)
-		    printf("<%s\n", ser_line) FLUSH;
+		    printf("<%s\n", line) FLUSH;
 # endif
-		if (NNTP_LIST_END(ser_line))
+		if (NNTP_LIST_END(line))
 		    break;
-		if ((t = index(ser_line, '\r')) != Nullch)
+		last_buf = line;
+		last_buflen = buflen_last_line_got;
+		if ((t = index(line, '\r')) != Nullch)
 		    *t = '\0';
-		if (!(t = index(ser_line, ' ')))
+		if (!(t = index(line, ' ')))
 		    continue;
 		t++;
-		num = atol(ser_line);
+		num = atol(line);
 		if (num < artnum || num > lastnum)
 		    continue;
@@ -403,4 +411,6 @@
 		    safecat(s,t,size);
 	    }
+	    if (last_buf != ser_line)
+		free(last_buf);
 	} else {
 	    fprintf(stderr,"\nUnexpected close of server socket.\n");
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads