From: <arc...@us...> - 2013-02-15 00:43:56
|
Revision: 631 http://sourceforge.net/p/sipp/code/631 Author: arcady-91 Date: 2013-02-15 00:43:54 +0000 (Fri, 15 Feb 2013) Log Message: ----------- Removing unused functions and fixing possible null pointer dereference Modified Paths: -------------- sipp/trunk/auth.c sipp/trunk/call.cpp sipp/trunk/prepare_pcap.c sipp/trunk/prepare_pcap.h Modified: sipp/trunk/auth.c =================================================================== --- sipp/trunk/auth.c 2013-02-15 00:43:48 UTC (rev 630) +++ sipp/trunk/auth.c 2013-02-15 00:43:54 UTC (rev 631) @@ -522,69 +522,7 @@ } char base64[64]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -char * base64_encode_string( const char *buf, unsigned int len, int *newlen ) -{ - int i,k; - int triplets,rest; - char *out,*ptr; - triplets = len/3; - rest = len%3; - out = (char *)malloc( ( triplets * 4 ) + 8 ); - - ptr = out; - for(i=0;i<triplets*3;i+=3){ - k = (((unsigned char) buf[i])&0xFC)>>2; - *ptr=base64[k];ptr++; - - k = (((unsigned char) buf[i])&0x03)<<4; - k |=(((unsigned char) buf[i+1])&0xF0)>>4; - *ptr=base64[k];ptr++; - - k = (((unsigned char) buf[i+1])&0x0F)<<2; - k |=(((unsigned char) buf[i+2])&0xC0)>>6; - *ptr=base64[k];ptr++; - - k = (((unsigned char) buf[i+2])&0x3F); - *ptr=base64[k];ptr++; - } - i=triplets*3; - switch(rest){ - case 0: - break; - case 1: - k = (((unsigned char) buf[i])&0xFC)>>2; - *ptr=base64[k];ptr++; - - k = (((unsigned char) buf[i])&0x03)<<4; - *ptr=base64[k];ptr++; - - *ptr='=';ptr++; - - *ptr='=';ptr++; - break; - case 2: - k = (((unsigned char) buf[i])&0xFC)>>2; - *ptr=base64[k];ptr++; - - k = (((unsigned char) buf[i])&0x03)<<4; - k |=(((unsigned char) buf[i+1])&0xF0)>>4; - *ptr=base64[k];ptr++; - - k = (((unsigned char) buf[i+1])&0x0F)<<2; - *ptr=base64[k];ptr++; - - *ptr='=';ptr++; - break; - } - // fprintf(stderr,"base64=%.*s >> %d\n",ptr-out,out,ptr-out); - *newlen = ptr-out; - return out; -} - - - - char hexa[16]="0123456789abcdef"; int createAuthHeaderAKAv1MD5(char * user, char * aka_OP, char * aka_AMF, Modified: sipp/trunk/call.cpp =================================================================== --- sipp/trunk/call.cpp 2013-02-15 00:43:48 UTC (rev 630) +++ sipp/trunk/call.cpp 2013-02-15 00:43:54 UTC (rev 631) @@ -2474,7 +2474,7 @@ sscanf(tmp,"%s", method); if (!auth_body) { - strcpy(auth_body, ""); + auth_body = ""; } /* Determine the type of credentials. */ Modified: sipp/trunk/prepare_pcap.c =================================================================== --- sipp/trunk/prepare_pcap.c 2013-02-15 00:43:48 UTC (rev 630) +++ sipp/trunk/prepare_pcap.c 2013-02-15 00:43:54 UTC (rev 631) @@ -196,10 +196,3 @@ return 0; } -void free_pkts(pcap_pkts *pkts) { - pcap_pkt *pkt_index = 0; - while (pkt_index < pkts->max) { - free(pkt_index->data); - } - free(pkts->pkts); -} Modified: sipp/trunk/prepare_pcap.h =================================================================== --- sipp/trunk/prepare_pcap.h 2013-02-15 00:43:48 UTC (rev 630) +++ sipp/trunk/prepare_pcap.h 2013-02-15 00:43:54 UTC (rev 631) @@ -74,7 +74,6 @@ int check(u_int16_t *, int); u_int16_t checksum_carry(int); int prepare_pkts(char *, pcap_pkts *); -void free_pkts(pcap_pkts *); #ifdef __cplusplus } #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |