All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandra Yates <alexandra.yates at linux.intel.com>
To: powertop@lists.01.org
Subject: Re: [Powertop] [Patches] snprintf, PATH_MAX + improvement of handling reporting filenames
Date: Thu, 17 Sep 2015 17:30:10 -0700	[thread overview]
Message-ID: <55FB5B12.8050709@linux.intel.com> (raw)
In-Reply-To: 1581639328.16307870.1431448558175.JavaMail.zimbra@redhat.com

[-- Attachment #1: Type: text/plain, Size: 1272 bytes --]

Your patch was added.

On 05/12/2015 09:35 AM, Jaroslav Skarvada wrote:
> Hi,
>
> I have noticed there are some sprintf that may lead to buffer
> overflows, e.g. the following can crash powertop:
>
> # powertop --csv=`printf 'a%.0s' {1..5000}`
>
> I attempted to fix hopefully most of them by converting
> the code to snprintf. For data returned by kernel
> it's probably unlikely to cause overflows, but why
> not cover it all. I also tried to unify buffer
> sizes for paths/filenames to PATH_MAX.
>
> The second patch tries to improve handling of reporting
> filenames. It works the following way:
>
> powertop --html
> generates 'powertop.html' file
>
> powertop --html=myfile.suffix
> generates 'myfile.suffix' file
>
> powertop -i 2 --html
> generates 'powertop-TIMESTAMPS.html' files
>
> powertop -i 2 --html=myfile.suffix
> generates 'myfile-TIMESTAMPS.suffix' files
>
> powertop -i 2 --html=myfile
> generates 'myfile-TIMESTAMPS' files
>
> Similarly for CSV.
>
> I think this is more logical behavior
>
> regards
>
> Jaroslav
>
>
>
> _______________________________________________
> PowerTop mailing list
> PowerTop(a)lists.01.org
> https://lists.01.org/mailman/listinfo/powertop
>

-- 
Thank you,
<Alexandra>

             reply	other threads:[~2015-09-18  0:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-18  0:30 Alexandra Yates [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-09-18  0:27 [Powertop] [Patches] snprintf, PATH_MAX + improvement of handling reporting filenames Alexandra Yates
2015-05-12 17:15 Jaroslav Skarvada
2015-05-12 16:35 Jaroslav Skarvada

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=55FB5B12.8050709@linux.intel.com \
    --to=powertop@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.