minor fixes + overlapping memcpy replaced with memmove

This commit is contained in:
z3APA3A 2014-06-11 00:54:58 +04:00
parent 53098814f0
commit 40d03b8a4a
4 changed files with 17 additions and 18 deletions

View File

@ -647,7 +647,7 @@ static int h_proxy(int argc, unsigned char ** argv){
childdef.isudp = 0; childdef.isudp = 0;
childdef.service = S_PROXY; childdef.service = S_PROXY;
childdef.helpmessage = " -n - no NTLM support\n"; childdef.helpmessage = " -n - no NTLM support\n";
if(!resolvfunc || (resolvfunc == myresolver && !dns_table->hashsize)){ if(!resolvfunc || (resolvfunc == myresolver && !dns_table.hashsize)){
fprintf(stderr, "[line %d] Warning: no nserver/nscache configured, proxy may run very slow\n", linenum); fprintf(stderr, "[line %d] Warning: no nserver/nscache configured, proxy may run very slow\n", linenum);
} }
} }
@ -678,7 +678,7 @@ static int h_proxy(int argc, unsigned char ** argv){
childdef.isudp = 0; childdef.isudp = 0;
childdef.service = S_SOCKS; childdef.service = S_SOCKS;
childdef.helpmessage = " -n - no NTLM support\n"; childdef.helpmessage = " -n - no NTLM support\n";
if(!resolvfunc || (resolvfunc == myresolver && !dns_table->hashsize)){ if(!resolvfunc || (resolvfunc == myresolver && !dns_table.hashsize)){
fprintf(stderr, "[line %d] Warning: no nserver/nscache configured, socks may run very slow\n", linenum); fprintf(stderr, "[line %d] Warning: no nserver/nscache configured, socks may run very slow\n", linenum);
} }
} }
@ -721,7 +721,7 @@ static int h_proxy(int argc, unsigned char ** argv){
childdef.port = 53; childdef.port = 53;
childdef.isudp = 1; childdef.isudp = 1;
childdef.service = S_DNSPR; childdef.service = S_DNSPR;
if(!resolvfunc || (resolvfunc == myresolver && !dns_table->hashsize) || resolvfunc == fake_resolver){ if(!resolvfunc || (resolvfunc == myresolver && !dns_table.hashsize) || resolvfunc == fakeresolver){
fprintf(stderr, "[line %d] Warning: no nserver/nscache configured, dnspr will not work as expected\n", linenum); fprintf(stderr, "[line %d] Warning: no nserver/nscache configured, dnspr will not work as expected\n", linenum);
} }
} }

View File

@ -882,20 +882,6 @@ struct auth authfuncs[] = {
}; };
struct hashentry {
unsigned char hash[sizeof(unsigned)*4];
unsigned long value;
time_t expires;
struct hashentry *next;
};
struct hashtable {
unsigned hashsize;
struct hashentry ** hashtable;
struct hashentry * hashvalues;
struct hashentry * hashempty;
};
struct hashtable dns_table = {0, NULL, NULL, NULL}; struct hashtable dns_table = {0, NULL, NULL, NULL};

View File

@ -339,7 +339,7 @@ for(;;){
if(!isconnect){ if(!isconnect){
if(se==sg)*se-- = ' '; if(se==sg)*se-- = ' ';
*se = '/'; *se = '/';
memcpy(ss, se, i - (se - sb) + 1); memmove(ss, se, i - (se - sb) + 1);
} }
} }
reqlen = i = (int)strlen((char *)buf); reqlen = i = (int)strlen((char *)buf);

View File

@ -657,6 +657,19 @@ typedef enum {
TYPE_SERVER TYPE_SERVER
}DATA_TYPE; }DATA_TYPE;
struct hashentry {
unsigned char hash[sizeof(unsigned)*4];
unsigned long value;
time_t expires;
struct hashentry *next;
};
struct hashtable {
unsigned hashsize;
struct hashentry ** hashtable;
struct hashentry * hashvalues;
struct hashentry * hashempty;
};
#ifdef __cplusplus #ifdef __cplusplus
} }