From: Tom Yu Date: Sat, 3 Jan 1998 03:36:53 +0000 (+0000) Subject: * locate_kdc.c (krb5_locate_kdc): Check return of X-Git-Tag: krb5-1.1-beta1~901 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b12b3df4aaa4725b942bfb553bdf160d61e5f139;p=krb5.git * locate_kdc.c (krb5_locate_kdc): Check return of malloc. [krb5-libs/518] * changepw.c (krb5_change_password): Check return of malloc. [krb5-libs/518] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10347 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index d530ee313..bb71df485 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,11 @@ +Fri Jan 2 21:28:56 1998 Tom Yu + + * locate_kdc.c (krb5_locate_kdc): Check return of + malloc. [krb5-libs/518] + + * changepw.c (krb5_change_password): Check return of + malloc. [krb5-libs/518] + Tue Dec 16 11:00:18 1997 Ezra Peisach * locate_kdc.c (krb5_locate_kdc): Free hostlist array elements diff --git a/src/lib/krb5/os/changepw.c b/src/lib/krb5/os/changepw.c index 78d9cd29c..75f04cb6b 100644 --- a/src/lib/krb5/os/changepw.c +++ b/src/lib/krb5/os/changepw.c @@ -126,6 +126,8 @@ krb5_change_password(context, creds, newpw, result_code, return(KADM_NO_HOST); addr_p = (struct sockaddr *) malloc(sizeof(struct sockaddr) * count); + if (addr_p == NULL) + return ENOMEM; host = hostlist[0]; out = 0; @@ -167,6 +169,8 @@ krb5_change_password(context, creds, newpw, result_code, addr_p = (struct sockaddr *) realloc ((char *)addr_p, sizeof(struct sockaddr) * count); + if (addr_p == NULL) + return ENOMEM; } } break; diff --git a/src/lib/krb5/os/locate_kdc.c b/src/lib/krb5/os/locate_kdc.c index 220d12e3c..c0ccf7e38 100644 --- a/src/lib/krb5/os/locate_kdc.c +++ b/src/lib/krb5/os/locate_kdc.c @@ -149,6 +149,8 @@ krb5_locate_kdc(context, realm, addr_pp, naddrs, master_index, nmasters) #endif addr_p = (struct sockaddr *)malloc (sizeof (struct sockaddr) * count); + if (addr_p == NULL) + return ENOMEM; for (i=0, out=0; hostlist[i]; i++) { host = hostlist[i]; @@ -195,6 +197,8 @@ krb5_locate_kdc(context, realm, addr_pp, naddrs, master_index, nmasters) addr_p = (struct sockaddr *) realloc ((char *)addr_p, sizeof(struct sockaddr) * count); + if (addr_p == NULL) + return ENOMEM; } if (sec_udpport && !port) { addr_p[out] = addr_p[out-1];