summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2000-02-26 01:25:19 +0000
committerKen Raeburn <raeburn@mit.edu>2000-02-26 01:25:19 +0000
commitfbeb8cabde4e43a462aa1db09ce766c537530cb9 (patch)
tree170253b755ca968a4754bdcc3090d41b8517222a /src/lib/krb5
parentd9b950dd26da3523dfb7462be427ba6bfe0fea05 (diff)
downloadkrb5-fbeb8cabde4e43a462aa1db09ce766c537530cb9.tar.gz
krb5-fbeb8cabde4e43a462aa1db09ce766c537530cb9.tar.xz
krb5-fbeb8cabde4e43a462aa1db09ce766c537530cb9.zip
forgot room for null pointer at end of local addr array
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12075 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5')
-rw-r--r--src/lib/krb5/os/ChangeLog1
-rw-r--r--src/lib/krb5/os/localaddr.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog
index 4db3cc384c..2d254ee6d4 100644
--- a/src/lib/krb5/os/ChangeLog
+++ b/src/lib/krb5/os/ChangeLog
@@ -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>
diff --git a/src/lib/krb5/os/localaddr.c b/src/lib/krb5/os/localaddr.c
index 30ebecb9d0..9079500e15 100644
--- a/src/lib/krb5/os/localaddr.c
+++ b/src/lib/krb5/os/localaddr.c
@@ -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;
}