Don't allow the size of active diagnostics parameter be bigger than
newly added I4B_ACTIVE_DIAGNOSTIC_MAXPARAMLEN (currently 64KB).
This commit is contained in:
parent
9e7c918fc2
commit
47849859a8
@ -27,7 +27,7 @@
|
||||
* i4b_i4bdrv.c - i4b userland interface driver
|
||||
* --------------------------------------------
|
||||
*
|
||||
* $Id: i4b_i4bdrv.c,v 1.4 2001/04/21 07:23:41 martin Exp $
|
||||
* $Id: i4b_i4bdrv.c,v 1.5 2001/08/05 11:16:56 jdolecek Exp $
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
@ -834,6 +834,12 @@ download_done:
|
||||
|
||||
if(req.in_param_len)
|
||||
{
|
||||
/* XXX arbitrary limit */
|
||||
if (req.in_param_len > I4B_ACTIVE_DIAGNOSTIC_MAXPARAMLEN) {
|
||||
error = EINVAL;
|
||||
goto diag_done;
|
||||
}
|
||||
|
||||
req.in_param = malloc(r->in_param_len, M_DEVBUF, M_WAITOK);
|
||||
|
||||
if(!req.in_param)
|
||||
|
@ -27,7 +27,7 @@
|
||||
* i4b_ioctl.h - messages kernel <--> userland
|
||||
* -------------------------------------------
|
||||
*
|
||||
* $Id: i4b_ioctl.h,v 1.1.1.1 2001/01/05 12:49:56 martin Exp $
|
||||
* $Id: i4b_ioctl.h,v 1.2 2001/08/05 11:16:56 jdolecek Exp $
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
@ -688,6 +688,7 @@ struct isdn_diagnostic_request {
|
||||
int controller; /* controller number */
|
||||
u_int32_t cmd; /* diagnostic command to execute */
|
||||
size_t in_param_len; /* length of additional input parameter */
|
||||
#define I4B_ACTIVE_DIAGNOSTIC_MAXPARAMLEN 65536
|
||||
void *in_param; /* optional input parameter */
|
||||
size_t out_param_len; /* available output space */
|
||||
void *out_param; /* output data goes here */
|
||||
|
Loading…
Reference in New Issue
Block a user