diff extensions/app_sip/multimediaauth.c @ 430:f77fc3a97287

Corrected compilation warnings on app_sip and test_sip
author Alexandre Westfahl <awestfahl@freediameter.net>
date Tue, 27 Jul 2010 14:56:21 +0900
parents 3d9f300f3b49
children 0d08a9ab2212
line wrap: on
line diff
--- a/extensions/app_sip/multimediaauth.c	Tue Jul 27 14:19:45 2010 +0900
+++ b/extensions/app_sip/multimediaauth.c	Tue Jul 27 14:56:21 2010 +0900
@@ -49,8 +49,10 @@
 	char password[51];
 	int idx=0, number_of_auth_items=0,i=0, ret=0;
 	//Flags and variables for Database
-	int sipurinotstored=0, authenticationpending=0, querylen=0, usernamelen=0;
-	char *query=NULL,*username=NULL;
+	int sipurinotstored=0, authenticationpending=0; 
+	size_t querylen=0, usernamelen=0;
+	char *query=NULL;
+	unsigned char *username=NULL;
 	
 	//The nonce we will store and retrieve in session
 	struct ds_nonce *storednonce=NULL;
@@ -151,7 +153,7 @@
 				//We allocate the double size of username because at worst it can be all quotes
 				username=malloc(avphdr->avp_value->os.len*2+1);
 				//We purify username not to have forbidden characters
-				usernamelen=mysql_real_escape_string(conn, username, (const char *)avphdr->avp_value->os.data, avphdr->avp_value->os.len);
+				usernamelen=mysql_real_escape_string(conn, (char *)username, (const char *)avphdr->avp_value->os.data, avphdr->avp_value->os.len);
 				
 				//Now that we know the user exist, we get the list of AOR owned by this user
 				querylen=SQL_GETSIPAOR_LEN + usernamelen;
@@ -199,13 +201,13 @@
 			
 			if(avphdr!=NULL)
 			{
-				char *sipuri=NULL;
+				unsigned char *sipuri=NULL;
 				int sipurilen=0;
 
 				//We allocate the double size of SIP-URI because at worst it can be all quotes
 				CHECK_MALLOC(sipuri=malloc(avphdr->avp_value->os.len*2+1));
 				//We purify SIP-URI not to have forbidden characters
-				sipurilen=mysql_real_escape_string(conn, sipuri, (const char *)avphdr->avp_value->os.data, avphdr->avp_value->os.len);
+				sipurilen=mysql_real_escape_string(conn, (char *)sipuri, (const char *)avphdr->avp_value->os.data, avphdr->avp_value->os.len);
 				
 				
 				//We get the SIP-URI assignated to the user
"Welcome to our mercurial repository"