Skip to content

Commit

Permalink
forgot room for null pointer at end of local addr array
Browse files Browse the repository at this point in the history
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12075 dc483132-0cff-0310-8789-dd5450dbe970
  • Loading branch information
raeburn committed Feb 26, 2000
1 parent 905d10f commit 6f08ea7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/lib/krb5/os/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
invoking callback functions; knows nothing about Kerberos.
(count_addrs, allocate, add_addr): New callback functions.
(krb5_os_localaddr): Use the above.
(allocate): Make room for NULL value at the end.

2000-02-16 Ken Raeburn <raeburn@mit.edu>

Expand Down
4 changes: 2 additions & 2 deletions src/lib/krb5/os/localaddr.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ allocate (void *P_data)
struct localaddr_data *data = P_data;
int i;

data->addr_temp = (krb5_address **) malloc (data->count * sizeof (krb5_address *));
data->addr_temp = (krb5_address **) malloc ((1 + data->count) * sizeof (krb5_address *));
if (data->addr_temp == 0)
return 1;
for (i = 0; i < data->count; i++)
for (i = 0; i <= data->count; i++)
data->addr_temp[i] = 0;
return 0;
}
Expand Down

0 comments on commit 6f08ea7

Please sign in to comment.