* hst_realm.c (krb5_try_realm_txt_rr): Apply patch from Nalin
Dahyabhai to bounds-check return value from res_search().
* locate_kdc.c (krb5_locate_srv_dns_1): Apply patch from Nalin
Dahyabhai to bounds-check return value from res_search().
ticket: 1216
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14928
dc483132-0cff-0310-8789-
dd5450dbe970
+2002-10-15 Tom Yu <tlyu@mit.edu>
+
+ * hst_realm.c (krb5_try_realm_txt_rr): Apply patch from Nalin
+ Dahyabhai to bounds-check return value from res_search().
+
+ * locate_kdc.c (krb5_locate_srv_dns_1): Apply patch from Nalin
+ Dahyabhai to bounds-check return value from res_search().
+
2002-10-11 Tom Yu <tlyu@mit.edu>
* read_pwd.c (krb5_read_password): Restore name of size_return.
}
size = res_search(host, C_IN, T_TXT, answer.bytes, sizeof(answer.bytes));
- if (size < 0)
+ if ((size < sizeof(HEADER)) || (size > sizeof(answer.bytes)))
return KRB5_ERR_HOST_REALM_UNKNOWN;
p = answer.bytes;
size = res_search(host, C_IN, T_SRV, answer.bytes, sizeof(answer.bytes));
- if (size < hdrsize)
+ if ((size < hdrsize) || (size > sizeof(answer.bytes)))
goto out;
/*