Re: [PATCH 01/11] votequorum: Check length of qdevice_name_req str

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/14/2013 10:18 AM, Jan Friesse wrote:
> Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx>
> ---
>  exec/votequorum.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/exec/votequorum.c b/exec/votequorum.c
> index 131b734..4c3532c 100644
> --- a/exec/votequorum.c
> +++ b/exec/votequorum.c
> @@ -1330,6 +1330,12 @@ static int votequorum_exec_send_qdevice_reg(uint32_t operation, const char *qdev
>  
>  	ENTER();
>  
> +	if (strlen(qdevice_name_req) >= VOTEQUORUM_QDEVICE_MAX_NAME_LEN) {
> +		log_printf(LOGSYS_LEVEL_ERROR, "Qdevice name %s is too long", qdevice_name_req);
> +
> +		return -1;
> +	}
> +
>  	req_exec_quorum_qdevice_reg.header.id = SERVICE_ID_MAKE(VOTEQUORUM_SERVICE, MESSAGE_REQ_EXEC_VOTEQUORUM_QDEVICE_REG);
>  	req_exec_quorum_qdevice_reg.header.size = sizeof(req_exec_quorum_qdevice_reg);
>  	req_exec_quorum_qdevice_reg.operation = operation;
> 

this check is unnecessary.

We don´t allow users to set qdevice_name >=
VOTEQUORUM_QDEVICE_MAX_NAME_LEN from qdevice_register in the library.

Fabio
_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss





[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux