[mw-devel] MW3 r1107 - trunk/src

welshbyte at sucs.org welshbyte at sucs.org
Sun Nov 22 15:12:31 GMT 2009


Author: welshbyte
Date: 2009-11-22 15:12:31 +0000 (Sun, 22 Nov 2009)
New Revision: 1107

Modified:
   trunk/src/add.c
Log:
Fix buffer overflow highlighted by -D_FORTIFY_SOURCE=2

[I'm not turning on _FORTIFY_SOURCE by default because it throws up a lot of
compile-time and runtime issues, some of which might not even be real problems,
but it seems that distros are starting to turn it on by default in their gcc
packages so it might be worth looking at the issues on a discretionary basis.]



Modified: trunk/src/add.c
===================================================================
--- trunk/src/add.c	2009-11-18 14:18:14 UTC (rev 1106)
+++ trunk/src/add.c	2009-11-22 15:12:31 UTC (rev 1107)
@@ -115,8 +115,8 @@
 	{
 		char t[NAMESIZE+1];
 		printf(_("Send to: "));
-		get_str(new->to,SUBJECTSIZE);
-		strncpy(t,new->to,SUBJECTSIZE);
+		get_str(new->to,NAMESIZE);
+		strncpy(t,new->to,NAMESIZE);
 		strip_name(t);
 		if (is_private(fol,user) && !is_old(&usr,t,&up))
 		{ 




More information about the mw-devel mailing list