From: Keith Vetter Date: Wed, 8 Mar 1995 04:44:54 +0000 (+0000) Subject: Fixed up some missing protocols and unchecked casts X-Git-Tag: krb5-1.0-beta5~586 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cbcf193b26d7e61b2492b5b969ec031759876d00;p=krb5.git Fixed up some missing protocols and unchecked casts git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5084 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/gssapi/generic/ChangeLog b/src/lib/gssapi/generic/ChangeLog index 2a8c9677e..325109f01 100644 --- a/src/lib/gssapi/generic/ChangeLog +++ b/src/lib/gssapi/generic/ChangeLog @@ -1,3 +1,11 @@ +Tue Mar 7 20:14:53 1995 Keith Vetter (keithv@fusion.com) + + * disp_maj.c: added casts on int->long assignments. + * util_can.c: made to work with PC winsockets. + * util_dup.c: added system include for prototype info. + * util_tok.c: int/long problems. + * gssapip_.h: added casts on int->char assignments. + Tue Feb 28 00:25:58 1995 John Gilmore (gnu at toad.com) * gssapi.h: Avoid includes. diff --git a/src/lib/gssapi/generic/disp_major_status.c b/src/lib/gssapi/generic/disp_major_status.c index d37b34e88..7dadd3e10 100644 --- a/src/lib/gssapi/generic/disp_major_status.c +++ b/src/lib/gssapi/generic/disp_major_status.c @@ -21,6 +21,7 @@ */ #include "gssapiP_generic.h" +#include /* This code has knowledge of the min and max errors of each type within the gssapi major status */ @@ -278,20 +279,20 @@ OM_uint32 INTERFACE g_display_major_status(minor_status, status_value, if (!tmp) { /* bogon input - there should be something left */ - *minor_status = G_BAD_MSG_CTX; + *minor_status = (OM_uint32) G_BAD_MSG_CTX; return(GSS_S_FAILURE); } /* compute the bit offset */ /*SUPPRESS 570*/ - for (bit=0; (1<>24):((num)&0xff); \ - (ptr)[1] = (bigend)?(((num)>>16)&0xff):(((num)>>8)&0xff); \ - (ptr)[2] = (bigend)?(((num)>>8)&0xff):(((num)>>16)&0xff); \ - (ptr)[3] = (bigend)?((num)&0xff):((num)>>24); \ + (ptr)[0] = (char) ((bigend)?((num)>>24):((num)&0xff)); \ + (ptr)[1] = (char) ((bigend)?(((num)>>16)&0xff):(((num)>>8)&0xff)); \ + (ptr)[2] = (char) ((bigend)?(((num)>>8)&0xff):(((num)>>16)&0xff)); \ + (ptr)[3] = (char) ((bigend)?((num)&0xff):((num)>>24)); \ (ptr) += 4; #define TREAD_INT(ptr, num, bigend) \ diff --git a/src/lib/gssapi/generic/util_canonhost.c b/src/lib/gssapi/generic/util_canonhost.c index 89de87a02..1a82c96d3 100644 --- a/src/lib/gssapi/generic/util_canonhost.c +++ b/src/lib/gssapi/generic/util_canonhost.c @@ -21,12 +21,16 @@ */ /* This file could be OS specific */ +#define NEED_SOCKETS #include "gssapiP_generic.h" -#ifndef _MSDOS + #include +#ifndef _WINSOCKAPI_ #include #include +#endif #include +#include char * INTERFACE g_canonicalize_host(hostname) @@ -61,4 +65,3 @@ g_canonicalize_host(hostname) return(canon); } -#endif diff --git a/src/lib/gssapi/generic/util_dup.c b/src/lib/gssapi/generic/util_dup.c index e3e3e52a6..d6ce11824 100644 --- a/src/lib/gssapi/generic/util_dup.c +++ b/src/lib/gssapi/generic/util_dup.c @@ -21,6 +21,7 @@ */ #include "gssapiP_generic.h" +#include char * INTERFACE g_strdup(str) char *str; diff --git a/src/lib/gssapi/generic/util_token.c b/src/lib/gssapi/generic/util_token.c index 424125d5d..c5067fde9 100644 --- a/src/lib/gssapi/generic/util_token.c +++ b/src/lib/gssapi/generic/util_token.c @@ -116,7 +116,7 @@ int INTERFACE g_token_size(mech, body_size) unsigned int body_size; { /* set body_size to sequence contents size */ - body_size += 4 + mech->length; + body_size += 4 + (int) mech->length; /* NEED overflow check */ return(1 + der_length_size(body_size) + body_size); } @@ -172,7 +172,9 @@ int INTERFACE g_verify_token_header(mech, body_size, buf, tok_type, toksize) return(0); toid.length = *(*buf)++; - if ((toksize-=toid.length) < 0) + if ((toid.length & VALID_INT_BITS) != toid.length) /* Overflow??? */ + return(0); + if ((toksize-= (int) toid.length) < 0) return(0); toid.elements = *buf; (*buf)+=toid.length;