[mw-devel] MW3 r1052 - trunk/src

arthur at sucs.org arthur at sucs.org
Thu Aug 7 16:44:53 BST 2008


Author: arthur
Date: 2008-08-07 16:44:53 +0100 (Thu, 07 Aug 2008)
New Revision: 1052

Modified:
   trunk/src/newmain.c
Log:
block attempts to set an overly long status


Modified: trunk/src/newmain.c
===================================================================
--- trunk/src/newmain.c	2008-07-21 15:08:23 UTC (rev 1051)
+++ trunk/src/newmain.c	2008-08-07 15:44:53 UTC (rev 1052)
@@ -451,6 +451,12 @@
 void c_doing(CommandList *cm, int argc, char **argv, char *args)
 {
 	if (argc > 1) {
+		if (strlen(args) > DOINGSIZE-1) {
+			char status[DOINGSIZE];
+			snprintf(status, DOINGSIZE, "%s", args);
+			printf("Status too long, would have been trunacted to '%s'\n", status);
+			return;
+		}
 		snprintf(user->doing, DOINGSIZE, "%s", args);
 		user->dowhen = time(0);
 		update_user(user,userposn);





More information about the mw-devel mailing list