[Freeswitch-svn] [commit] r3471 - freeswitch/trunk/src/mod/applications/mod_commands

Freeswitch SVN ptinsley at freeswitch.org
Tue Nov 28 15:20:22 EST 2006


Author: ptinsley
Date: Tue Nov 28 15:20:22 2006
New Revision: 3471

Modified:
   freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c

Log:
Fix a few overflow problems


Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c	Tue Nov 28 15:20:22 2006
@@ -579,9 +579,9 @@
 		holder.print_title = 0;
 		if ((cmdname = strchr(cmd, ' ')) != 0) {
 			*cmdname++ = '\0';
-			sprintf (sql, "select name, syntax, description from interfaces where type = 'api' and name = '%s'", cmdname);
+			snprintf (sql, sizeof(sql) - 1, "select name, syntax, description from interfaces where type = 'api' and name = '%s'", cmdname);
 		} else {
-			sprintf (sql, "select name, syntax, description from interfaces where type = 'api'");
+			snprintf (sql, sizeof(sql) - 1, "select name, syntax, description from interfaces where type = 'api'");
 		}
 	} else {
 		stream->write_function(stream, "USAGE: %s\n", show_api_interface.syntax);
@@ -633,7 +633,7 @@
 		sprintf (showcmd, "help");
 		all = 1;
 	} else {
-		sprintf (showcmd, "help %s", cmd);
+		snprintf(showcmd, sizeof(showcmd) -1, "help %s", cmd);
 	}
 
 	if (all) {



More information about the Freeswitch-svn mailing list