Skip to content

Commit

Permalink
ticket: new
Browse files Browse the repository at this point in the history
status: open
subject: krb5int_gic_opte_copy should copy elements individually

Since we are copying from one structure to another, copy elements.
Using memcpy is fragile.


git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20499 dc483132-0cff-0310-8789-dd5450dbe970
  • Loading branch information
lxs committed Jul 7, 2008
1 parent 263293d commit fbbda77
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/lib/krb5/krb/gic_opt.c
Expand Up @@ -216,8 +216,19 @@ krb5int_gic_opte_copy(krb5_context context,
if (NULL == oe)
return ENOMEM;

if (opt)
memcpy(oe, opt, sizeof(*opt));
if (opt) {
oe->flags = opt->flags;
oe->tkt_life = opt->tkt_life;
oe->renew_life = opt->renew_life;
oe->forwardable = opt->forwardable;
oe->proxiable = opt->proxiable;
oe->etype_list = opt->etype_list;
oe->etype_list_length = opt->etype_list_length;
oe->address_list = opt->address_list;
oe->preauth_list = opt->preauth_list;
oe->preauth_list_length = opt->preauth_list_length;
oe->salt = opt->salt;
}

/*
* Fix the flags -- the EXTENDED flag would have been
Expand Down

0 comments on commit fbbda77

Please sign in to comment.