svn rev #21876: trunk/src/ appl/bsd/ kadmin/ktutil/ lib/crypto/arcfour/ lib/gssapi/mechglue/ ...
raeburn@MIT.EDU
raeburn at MIT.EDU
Tue Feb 3 11:38:38 EST 2009
http://src.mit.edu/fisheye/changelog/krb5/?cs=21876
Commit By: raeburn
Log Message:
prefer structure assignment to memcpy
Changed Files:
U trunk/src/appl/bsd/krlogin.c
U trunk/src/kadmin/ktutil/ktutil_funcs.c
U trunk/src/lib/crypto/arcfour/arcfour.c
U trunk/src/lib/gssapi/mechglue/g_initialize.c
U trunk/src/lib/kadm5/srv/svr_principal.c
U trunk/src/lib/krb5/krb/serialize.c
Modified: trunk/src/appl/bsd/krlogin.c
===================================================================
--- trunk/src/appl/bsd/krlogin.c 2009-02-02 23:41:40 UTC (rev 21875)
+++ trunk/src/appl/bsd/krlogin.c 2009-02-03 16:38:34 UTC (rev 21876)
@@ -1663,8 +1663,7 @@
** copy the initial modes we saved into sb; this is
** for restoring to the initial state
*/
- (void)memcpy(&sb, &defmodes, sizeof(defmodes));
-
+ sb = defmodes;
#else
sb.sg_flags &= ~(CBREAK|RAW|TBDELAY);
sb.sg_flags |= defflags|tabflag;
Modified: trunk/src/kadmin/ktutil/ktutil_funcs.c
===================================================================
--- trunk/src/kadmin/ktutil/ktutil_funcs.c 2009-02-02 23:41:40 UTC (rev 21875)
+++ trunk/src/kadmin/ktutil/ktutil_funcs.c 2009-02-03 16:38:34 UTC (rev 21876)
@@ -172,7 +172,7 @@
goto cleanup;
memset(password.data, 0, password.length);
password.length = 0;
- memcpy(&lp->entry->key, &key, sizeof(krb5_keyblock));
+ lp->entry->key = key;
} else {
printf("Key for %s (hex): ", princ_str);
fgets(buf, BUFSIZ, stdin);
Modified: trunk/src/lib/crypto/arcfour/arcfour.c
===================================================================
--- trunk/src/lib/crypto/arcfour/arcfour.c 2009-02-02 23:41:40 UTC (rev 21875)
+++ trunk/src/lib/crypto/arcfour/arcfour.c 2009-02-03 16:38:34 UTC (rev 21876)
@@ -81,7 +81,7 @@
d1.data=malloc(d1.length);
if (d1.data == NULL)
return (ENOMEM);
- memcpy(&k1, key, sizeof (krb5_keyblock));
+ k1 = *key;
k1.length=d1.length;
k1.contents= (void *) d1.data;
@@ -91,7 +91,7 @@
free(d1.data);
return (ENOMEM);
}
- memcpy(&k2, key, sizeof (krb5_keyblock));
+ k2 = *key;
k2.length=d2.length;
k2.contents=(void *) d2.data;
@@ -102,7 +102,7 @@
free(d2.data);
return (ENOMEM);
}
- memcpy(&k3, key, sizeof (krb5_keyblock));
+ k3 = *key;
k3.length=d3.length;
k3.contents= (void *) d3.data;
@@ -201,7 +201,7 @@
d1.data=malloc(d1.length);
if (d1.data == NULL)
return (ENOMEM);
- memcpy(&k1, key, sizeof (krb5_keyblock));
+ k1 = *key;
k1.length=d1.length;
k1.contents= (void *) d1.data;
@@ -211,7 +211,7 @@
free(d1.data);
return (ENOMEM);
}
- memcpy(&k2, key, sizeof(krb5_keyblock));
+ k2 = *key;
k2.length=d2.length;
k2.contents= (void *) d2.data;
@@ -222,7 +222,7 @@
free(d2.data);
return (ENOMEM);
}
- memcpy(&k3, key, sizeof(krb5_keyblock));
+ k3 = *key;
k3.length=d3.length;
k3.contents= (void *) d3.data;
Modified: trunk/src/lib/gssapi/mechglue/g_initialize.c
===================================================================
--- trunk/src/lib/gssapi/mechglue/g_initialize.c 2009-02-02 23:41:40 UTC (rev 21875)
+++ trunk/src/lib/gssapi/mechglue/g_initialize.c 2009-02-03 16:38:34 UTC (rev 21876)
@@ -638,7 +638,7 @@
releaseMechInfo(&new_cf);
return ENOMEM;
}
- memcpy(new_cf->mech, template->mech, sizeof(struct gss_config));
+ *new_cf->mech = *template->mech;
if (template->mech_type != NULL)
new_cf->mech->mech_type = *(template->mech_type);
new_cf->mech_type = &new_cf->mech->mech_type;
Modified: trunk/src/lib/kadm5/srv/svr_principal.c
===================================================================
--- trunk/src/lib/kadm5/srv/svr_principal.c 2009-02-02 23:41:40 UTC (rev 21875)
+++ trunk/src/lib/kadm5/srv/svr_principal.c 2009-02-03 16:38:34 UTC (rev 21876)
@@ -56,7 +56,7 @@
return ENOMEM;
VALGRIND_CHECK_DEFINED(*inprinc);
- memcpy(tempprinc, inprinc, sizeof(krb5_principal_data));
+ *tempprinc = *inprinc;
nelems = (int) krb5_princ_size(context, inprinc);
tempprinc->data = krb5_db_alloc(context, NULL, nelems * sizeof(krb5_data));
Modified: trunk/src/lib/krb5/krb/serialize.c
===================================================================
--- trunk/src/lib/krb5/krb/serialize.c 2009-02-02 23:41:40 UTC (rev 21875)
+++ trunk/src/lib/krb5/krb/serialize.c 2009-02-03 16:38:34 UTC (rev 21876)
@@ -84,7 +84,7 @@
kret = ENOMEM;
}
else
- memcpy(stable, entry, sizeof(krb5_ser_entry));
+ *stable = *entry;
return(kret);
}
More information about the cvs-krb5
mailing list