On 6/14/2013 10:18 AM, Jan Friesse wrote:
> Signed-off-by: Jan Friesse <[email protected]>
> ---
>  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
[email protected]
http://lists.corosync.org/mailman/listinfo/discuss

Reply via email to