+1998-05-18 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * util_ordering.c (g_order_free):
+ * rel_oid_set.c (generic_gss_release_oid_set):
+ * disp_major_status.c: General lint cleanup.
+
+ * util_oid.c (g_copy_OID_set): Copy the OID set with entirely
+ dynamic memory (don't alias the contents of the OID set).
+
Wed Apr 1 16:33:27 1998 Tom Yu <tlyu@mit.edu>
* disp_major_status.c (g_display_major_status): Fix a typo in
#include "gssapiP_generic.h"
#include <string.h>
+#include <stdio.h>
/*
* $Id$
{
const char *str;
- if (str = GSS_CALLING_ERROR_STR(code)) {
+ if ((str = GSS_CALLING_ERROR_STR(code))) {
if (! g_make_string_buffer(str, status_string)) {
*minor_status = ENOMEM;
return(GSS_S_FAILURE);
{
const char *str;
- if (str = GSS_ROUTINE_ERROR_STR(code)) {
+ if ((str = GSS_ROUTINE_ERROR_STR(code))) {
if (! g_make_string_buffer(str, status_string)) {
*minor_status = ENOMEM;
return(GSS_S_FAILURE);
{
const char *str;
- if (str = GSS_SINFO_STR(code)) {
+ if ((str = GSS_SINFO_STR(code))) {
if (! g_make_string_buffer(str, status_string)) {
*minor_status = ENOMEM;
return(GSS_S_FAILURE);
/*** do routine error */
if (*message_context == 0) {
- if (tmp = GSS_ROUTINE_ERROR(status_value)) {
+ if ((tmp = GSS_ROUTINE_ERROR(status_value))) {
status_value -= tmp;
- if (ret = display_routine(minor_status, tmp, status_string))
+ if ((ret = display_routine(minor_status, tmp, status_string)))
return(ret);
*minor_status = 0;
if (status_value) {
/*** do calling error */
if (*message_context == 1) {
- if (tmp = GSS_CALLING_ERROR(status_value)) {
+ if ((tmp = GSS_CALLING_ERROR(status_value))) {
status_value -= tmp;
- if (ret = display_calling(minor_status, tmp, status_string))
+ if ((ret = display_calling(minor_status, tmp, status_string)))
return(ret);
*minor_status = 0;
if (status_value) {
for (bit=0; (((OM_uint32) 1)<<bit) != LSBGET(tmp); bit++) ;
/* print it */
- if (ret = display_bit(minor_status, bit, status_string))
+ if ((ret = display_bit(minor_status, bit, status_string)))
return(ret);
/* compute the new status_value/message_context */
*/
#include "gssapiP_generic.h"
+#include "string.h"
/*
* $Id$
gss_OID_set *out;
{
gss_OID_set copy;
- size_t i;
+ gss_OID new_oid;
+ size_t i;
+ size_t len;
*out = NULL;
return(0);
copy->count = in->count;
+ len = sizeof(gss_OID_desc) * copy->count;
if ((copy->elements =
- (gss_OID_desc *) xmalloc(sizeof(gss_OID_desc)*copy->count)) == NULL) {
+ (gss_OID_desc *) xmalloc( len )) == NULL) {
xfree(copy);
return(0);
}
- for (i=0; i<in->count; i++)
- copy->elements[i] = in->elements[i];
+ memset( copy->elements, 0, len );
+
+ for (i=0; i<in->count; i++) {
+ len = in->elements[i].length;
+ new_oid = &(copy->elements[i]);
+ new_oid->elements = xmalloc( len );
+ if ( new_oid->elements == NULL ) {
+ while( i>0 ) {
+ i--;
+ new_oid = &(copy->elements[i]);
+ if ( new_oid->elements!=NULL )
+ xfree( new_oid->elements );
+ }
+ xfree( copy->elements );
+ xfree( copy );
+ return( 0 );
+ }
+ memcpy( new_oid->elements, in->elements[i].elements, len );
+ new_oid->length = len;
+ }
*out = copy;
return(1);