From: "Hunt, David" <david.hunt@intel.com>
To: Reshma Pattan <reshma.pattan@intel.com>, dev@dpdk.org
Cc: stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] examples/vm_power_manager: fix string null termination
Date: Mon, 15 Apr 2019 15:50:55 +0100 [thread overview]
Message-ID: <a6379eb7-ad57-58f4-8c66-361aa6b2cc8f@intel.com> (raw)
Message-ID: <20190415145055.GZ-i1bJW-60ey-HhlXsld20m--GfswBPPB2qNORSmRQ@z> (raw)
In-Reply-To: <20190409160024.40431-1-reshma.pattan@intel.com>
On 9/4/2019 5:00 PM, Reshma Pattan wrote:
> After the read() the jason_data null termination is missing
> for the case "indent < 0", for "indent > 0" and "indent == 0"
> cases null termination is already handled.
>
> So add the missing case "indent < 0" to the existing "indent == 0"
> case to fix null termination.
>
> Coverity issue: 337680
> Fixes: a63504a90f ("examples/power: add JSON string handling")
> CC: david.hunt@intel.com
> CC: stable@dpdk.org
>
> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> ---
> examples/vm_power_manager/channel_monitor.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c
> index 74df0fe20..c67ca4710 100644
> --- a/examples/vm_power_manager/channel_monitor.c
> +++ b/examples/vm_power_manager/channel_monitor.c
> @@ -807,7 +807,7 @@ read_json_packet(struct channel_info *chan_info)
> indent--;
> if ((indent > 0) || (idx > 0))
> idx++;
> - if (indent == 0)
> + if (indent <= 0)
> json_data[idx] = 0;
> if (idx >= MAX_JSON_STRING_LEN-1)
> break;
Acked-by: David Hunt <david.hunt@intel.com>
next prev parent reply other threads:[~2019-04-15 14:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-09 16:00 Reshma Pattan
2019-04-09 16:00 ` Reshma Pattan
2019-04-15 14:50 ` Hunt, David [this message]
2019-04-15 14:50 ` Hunt, David
2019-04-22 21:13 ` Thomas Monjalon
2019-04-22 21:13 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a6379eb7-ad57-58f4-8c66-361aa6b2cc8f@intel.com \
--to=david.hunt@intel.com \
--cc=dev@dpdk.org \
--cc=reshma.pattan@intel.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).