X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lib-src%2Fgnuserv.c;h=0c8cf22dc40253cc66059e2a94cb50f14a2ba92e;hb=e9cdc675ebf6c37c74534adc024b5c723a81ccba;hp=2ba5785f666388b9eb82b9a16f266ada21b42e57;hpb=40402600969429d5253e62c6314a3eebbb21f027;p=chise%2Fxemacs-chise.git.1 diff --git a/lib-src/gnuserv.c b/lib-src/gnuserv.c index 2ba5785..0c8cf22 100644 --- a/lib-src/gnuserv.c +++ b/lib-src/gnuserv.c @@ -458,8 +458,6 @@ permitted (unsigned long host_addr, int fd) char auth_protocol[128]; char buf[1024]; int auth_data_len; - int auth_data_pos; - int auth_mismatches; if (fd > 0) { @@ -492,7 +490,7 @@ permitted (unsigned long host_addr, int fd) auth_data_len = atoi(buf); - if (auth_data_len <= 0 || auth_data_len > sizeof(buf)) + if (auth_data_len <= 0 || auth_data_len > (int) sizeof(buf)) { return FALSE; } @@ -502,10 +500,11 @@ permitted (unsigned long host_addr, int fd) #ifdef AUTH_MAGIC_COOKIE if (server_xauth && server_xauth->data) - { + { /* Do a compare without comprising info about the size of the cookie */ - auth_mismatches = + int auth_data_pos; + int auth_mismatches = ( auth_data_len ^ server_xauth->data_length ); @@ -518,7 +517,7 @@ permitted (unsigned long host_addr, int fd) return TRUE; for(;rand() % 1000;); - } + } #else printf ("client tried Xauth, but server is not compiled with Xauth\n"); @@ -598,6 +597,7 @@ setup_table (void) char hostname[HOSTNAMSZ]; unsigned int host_addr; int i, hosts=0; + int t; /* Make sure every entry is null */ for (i=0; i