should strnStackAdd null terminate data?

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

 



Hi:
	Firstly you guys should note that it's midnight down
here so anything I say may be insane:)

	It seems that CMDarticle assumes that art_stack->data
is null terminated while strnStackAdd doesn't seem to do that.
The appended patch fixes this though I'm suspicious of it as
it never affected me till tonight :(

	Julian, could you clarify the semantics of strnStackAdd?
Thanks.

-- 
Debian GNU/Linux 1.1 is out! { http://www.debian.org/ }
Email:  Herbert Xu ~{PmV>HI~} <herbert@greathan.apana.org.au>
{ http://greathan.apana.org.au/~herbert/ }
PGP Key:  pgp-public-keys@pgp.mit.edu or any other key sites
--
diff -ur nntpcache-current.orig/libproff/str.c nntpcache-current/libproff/str.c
--- nntpcache-current.orig/libproff/str.c	Sun Sep 15 20:38:41 1996
+++ nntpcache-current/libproff/str.c	Sat Oct  5 00:03:21 1996
@@ -319,7 +319,7 @@
 		l->len += STRSTACK_BLOCK_SIZE;
 		l->data = Srealloc (l->data, l->len);
 	}
-	memcpy (l->data + l->used - 1, s, len);
+	memcpy (l->data + l->used - 1, s, len + 1);
 	l->used += len;
 	return l;
 }


[Index of Archives]     [Yosemite]     [Yosemite Campsites]     [Bugtraq]     [Linux]     [Trn]

Powered by Linux