summary refs log tree commit diff stats
path: root/src/common/outbound.c
diff options
context:
space:
mode:
authorDiogo Sousa <diogogsousa@gmail.com>2013-06-08 02:56:36 +0100
committerDiogo Sousa <diogogsousa@gmail.com>2013-06-08 02:56:36 +0100
commitf84476cf87b1740ddbd7b3d829f417c51c7bd039 (patch)
treea67e7f18068cad7a9cde76835a9d5c154d29107b /src/common/outbound.c
parent951292abe1ce97751b80e62b69623d9f712a0914 (diff)
Fixed possible overflow in create_mask().
Diffstat (limited to 'src/common/outbound.c')
-rw-r--r--src/common/outbound.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/common/outbound.c b/src/common/outbound.c
index 1e90016e..84240a47 100644
--- a/src/common/outbound.c
+++ b/src/common/outbound.c
@@ -487,19 +487,19 @@ create_mask (session * sess, char *mask, char *mode, char *typestr, int deop)
 			switch (type)
 			{
 			case 0:
-				snprintf (tbuf, TBUFSIZE, "%s%s *!*@%s.*", mode, p2, domain);
+				snprintf (tbuf, sizeof (tbuf), "%s%s *!*@%s.*", mode, p2, domain);
 				break;
 
 			case 1:
-				snprintf (tbuf, TBUFSIZE, "%s%s *!*@%s", mode, p2, fullhost);
+				snprintf (tbuf, sizeof (tbuf), "%s%s *!*@%s", mode, p2, fullhost);
 				break;
 
 			case 2:
-				snprintf (tbuf, TBUFSIZE, "%s%s *!%s@%s.*", mode, p2, username, domain);
+				snprintf (tbuf, sizeof (tbuf), "%s%s *!%s@%s.*", mode, p2, username, domain);
 				break;
 
 			case 3:
-				snprintf (tbuf, TBUFSIZE, "%s%s *!%s@%s", mode, p2, username, fullhost);
+				snprintf (tbuf, sizeof (tbuf), "%s%s *!%s@%s", mode, p2, username, fullhost);
 				break;
 			}
 		} else
@@ -507,26 +507,26 @@ create_mask (session * sess, char *mask, char *mode, char *typestr, int deop)
 			switch (type)
 			{
 			case 0:
-				snprintf (tbuf, TBUFSIZE, "%s%s *!*@*%s", mode, p2, domain);
+				snprintf (tbuf, sizeof (tbuf), "%s%s *!*@*%s", mode, p2, domain);
 				break;
 
 			case 1:
-				snprintf (tbuf, TBUFSIZE, "%s%s *!*@%s", mode, p2, fullhost);
+				snprintf (tbuf, sizeof (tbuf), "%s%s *!*@%s", mode, p2, fullhost);
 				break;
 
 			case 2:
-				snprintf (tbuf, TBUFSIZE, "%s%s *!%s@*%s", mode, p2, username, domain);
+				snprintf (tbuf, sizeof (tbuf), "%s%s *!%s@*%s", mode, p2, username, domain);
 				break;
 
 			case 3:
-				snprintf (tbuf, TBUFSIZE, "%s%s *!%s@%s", mode, p2, username, fullhost);
+				snprintf (tbuf, sizeof (tbuf), "%s%s *!%s@%s", mode, p2, username, fullhost);
 				break;
 			}
 		}
 
 	} else
 	{
-		snprintf (tbuf, TBUFSIZE, "%s %s", mode, mask);
+		snprintf (tbuf, sizeof (tbuf), "%s %s", mode, mask);
 	}
 	
 	return g_strdup (tbuf);