[Freeswitch-svn] [commit] r4188 - freeswitch/trunk/src

Freeswitch SVN mikej at freeswitch.org
Fri Feb 9 17:56:42 EST 2007


Author: mikej
Date: Fri Feb  9 17:56:42 2007
New Revision: 4188

Modified:
   freeswitch/trunk/src/switch_utils.c

Log:
add some error checking to switch_url_encode function

Modified: freeswitch/trunk/src/switch_utils.c
==============================================================================
--- freeswitch/trunk/src/switch_utils.c	(original)
+++ freeswitch/trunk/src/switch_utils.c	Fri Feb  9 17:56:42 2007
@@ -599,7 +599,16 @@
     const char urlunsafe[] = "\r\n \"#%&+:;<=>?@[\\]^`{|}";
     const char hex[] = "0123456789ABCDEF";
 
+	if (!buf) {
+		return 0;
+	}
+
     memset(buf, 0, len);
+
+	if (!url) {
+		return 0;
+	}
+
     for( p = url ; *p ; p++) {
         if (*p < ' ' || *p > '~' || strchr(urlunsafe, *p)) {
             if ((x + 3) > len) {



More information about the Freeswitch-svn mailing list