Skip to content

Commit

Permalink
ticket: 5394
Browse files Browse the repository at this point in the history
version_fixed: 1.6.1

pull up r19065 from trunk

 r19065@cathode-dark-space:  jaltman | 2007-01-18 06:35:33 -0500
 ticket: 5394
 tags: pullup
 
   	sendto_kdc.c: use of a variable index into a dynamically 
 	allocated array to determine the sizeof() an object makes
 	it unclear what type of object is involved.  It also requires
 	a runtime check instead of a compile time replacement.  
 	Not to mention that it could lead to the evaluation of an 
 	uninitialized variable as was done in this case.  Replace
 	sizeof(array index variable) with sizeof(type). 
 
 	memset() the correct data structure.  
 
 



git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-6@19111 dc483132-0cff-0310-8789-dd5450dbe970
  • Loading branch information
tlyu committed Jan 24, 2007
1 parent c271f22 commit bc2418a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/krb5/os/sendto_kdc.c
Expand Up @@ -1127,15 +1127,15 @@ krb5int_sendto (krb5_context context, const krb5_data *message,
return ENOMEM;
}

memset(conns, 0, n_conns * sizeof(conns[i]));
memset(conns, 0, n_conns * sizeof(struct conn_state));

if (callback_info) {
callback_data = malloc(n_conns * sizeof(krb5_data));
if (callback_data == NULL) {
return ENOMEM;
}

memset(conns, 0, n_conns * sizeof(callback_data[i]));
memset(callback_data, 0, n_conns * sizeof(krb5_data));
}

for (i = 0; i < n_conns; i++) {
Expand Down

0 comments on commit bc2418a

Please sign in to comment.