On Fri, Jul 24, 2015 at 3:59 AM, Balasubramanian Manoharan <
[email protected]> wrote:

> From: Bala Manoharan <[email protected]>
>
> Fixes: https://bugs.linaro.org/show_bug.cgi?id=1512
>
> Signed-off-by: Balasubramanian Manoharan <[email protected]>
>

Reviewed-by: Bill Fischofer <[email protected]>


> ---
>  example/classifier/odp_classifier.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/example/classifier/odp_classifier.c
> b/example/classifier/odp_classifier.c
> index 4f741d0..030eb8b 100644
> --- a/example/classifier/odp_classifier.c
> +++ b/example/classifier/odp_classifier.c
> @@ -605,10 +605,10 @@ static int parse_pmr_policy(appl_args_t *appl_args,
> char *argv[], char *optarg)
>         switch (term)   {
>         case ODP_PMR_SIP_ADDR:
>                 token = strtok(NULL, ":");
> -               strcpy(stats[policy_count].value, token);
> +               strncpy(stats[policy_count].value, token,
> DISPLAY_STRING_LEN);
>                 parse_ipv4_addr(token, &stats[policy_count].rule.val);
>                 token = strtok(NULL, ":");
> -               strcpy(stats[policy_count].mask, token);
> +               strncpy(stats[policy_count].mask, token,
> DISPLAY_STRING_LEN);
>                 parse_ipv4_mask(token, &stats[policy_count].rule.mask);
>                 stats[policy_count].val_sz = 4;
>         break;
> @@ -619,7 +619,8 @@ static int parse_pmr_policy(appl_args_t *appl_args,
> char *argv[], char *optarg)
>
>         /* Queue Name */
>         token = strtok(NULL, ":");
> -       strcpy(stats[policy_count].queue_name, token);
> +
> +       strncpy(stats[policy_count].queue_name, token, ODP_QUEUE_NAME_LEN);
>         appl_args->policy_count++;
>         free(pmr_str);
>         return 0;
> --
> 1.9.1
>
> _______________________________________________
> lng-odp mailing list
> [email protected]
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to