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.
ticket: 5394
tags: pullup
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19065
dc483132-0cff-0310-8789-
dd5450dbe970
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));
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++) {