All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH 2/2] obex: Work-around compilation failure
Date: Fri, 24 Nov 2017 16:22:59 +0100	[thread overview]
Message-ID: <1511536979.11411.23.camel@hadess.net> (raw)
In-Reply-To: <CABBYNZ+SJ0maQVjyfxgawvqiV6z-RrpYaCwb0cdCQpw5dzvMuw@mail.gmail.com>

On Fri, 2017-11-24 at 16:48 +0200, Luiz Augusto von Dentz wrote:
> Hi Bastien,
> 
> On Fri, Nov 24, 2017 at 4:06 PM, Bastien Nocera <hadess@hadess.net>
> wrote:
> > On Thu, 2017-11-02 at 15:09 +0100, Bastien Nocera wrote:
> > > obexd/plugins/bluetooth.c: In function 'register_profile':
> > > obexd/plugins/bluetooth.c:310:7: error: format not a string
> > > literal,
> > > argument types not checked [-Werror=format-nonliteral]
> > >        profile->driver->port);
> > >        ^~~~~~~
> > > obexd/plugins/bluetooth.c:314:7: error: format not a string
> > > literal,
> > > argument types not checked [-Werror=format-nonliteral]
> > >        profile->driver->name);
> > >        ^~~~~~~
> > 
> > 
> > And so does this one.
> 
> I really hope we can avoid GCC specific pragmas,

I'm pretty sure it just won't do anything with other compilers.

>  there got to be a
> better way avoid this error

A lot of code refactoring.

>  or just disable
> -Werror=format-nonliteral, actually is that our error or
> g_markup_printf_escaped?

It's the g_markup_printf_escaped() usage that incorrect. The first
argument of printf-style functions are supposed to be literals,
otherwise the compiler doesn't know whether the arguments passed match
the format.

It's a potential security bug, depending on where the format comes
from, and how it's generated.

Removing the warning/error doesn't remove the bug, it just hides it.
And so does this patch. I don't know the codebase enough to refactor
it.

Cheers

  reply	other threads:[~2017-11-24 15:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-02 14:09 [PATCH 1/2] tools/csr_usb: Fix compilation failure Bastien Nocera
2017-11-02 14:09 ` [PATCH 2/2] obex: Work-around " Bastien Nocera
2017-11-24 14:06   ` Bastien Nocera
2017-11-24 14:48     ` Luiz Augusto von Dentz
2017-11-24 15:22       ` Bastien Nocera [this message]
2017-11-02 14:11 ` [PATCH 1/2] tools/csr_usb: Fix " Bastien Nocera
2017-11-24 14:06 ` Bastien Nocera

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=1511536979.11411.23.camel@hadess.net \
    --to=hadess@hadess.net \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    /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.