Validate some counts that may be received from the network:
Check that they are non-negative, and that they are small enough to avoid integer overflow when used in memory allocation calculations. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11411 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -186,6 +186,8 @@ krb5_ret_xdr_data(krb5_storage *sp,
|
||||
ret = krb5_ret_int32(sp, &size);
|
||||
if(ret)
|
||||
return ret;
|
||||
if(size < 0)
|
||||
return ERANGE;
|
||||
data->length = size;
|
||||
if (size) {
|
||||
u_char foo[4];
|
||||
|
Reference in New Issue
Block a user