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

Re: [leafnode-list] More embedded NULLs in posts



On Sat, Aug 12, 2000 at 02:49:25PM -0500, Mike Castle wrote:
> Consider this following extract from strace -s 4096 telnet newsserver nntp:
> recv(4, ".....\r\nend\r\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\r\n\r\n.\r\n", 7819, 0) = 1468

[deleted]

> When the getaline() stuff came up, someone mentioned a potential missed
> patch for the 1.9 series that I pretty much duplicated.  Would this fall
> into the same situation?  I'm beginning to think my patch wasn't
> sufficient.

Ok, getaline() is still broken.  Less broken, but still broken.

Just because line is zero length, it doesn't mean it's an error or end of
file.

diff -ru leafnode-1.9.15.orig/miscutil.c leafnode-1.9.15/miscutil.c
--- leafnode-1.9.15.orig/miscutil.c	Tue Aug  1 08:05:13 2000
+++ leafnode-1.9.15/miscutil.c	Sat Aug 12 19:20:01 2000
@@ -705,7 +705,7 @@
 	buf = critrealloc(buf, size, "reading line" );
     }
 
-    if ( len == 0 )
+    if ( len == 0 && p == NULL )
 	return NULL;
 
     if (len && (buf[len-1] == '\n')) { /* go back on top of the newline */


-- 
       Mike Castle       Life is like a clock:  You can work constantly
  dalgoda@xxxxxxxxxxxxx  and be right all the time, or not work at all
www.netcom.com/~dalgoda/ and be right at least twice a day.  -- mrc
    We are all of us living in the shadow of Manhattan.  -- Watchmen

-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list