ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Led <ledest@gmail.com>
To: devel@lists.altlinux.org
Subject: Re: [devel] Добавление -Werror=format-security
Date: Wed, 3 Jun 2009 15:19:43 +0300
Message-ID: <200906031519.43673.ledest@gmail.com> (raw)
In-Reply-To: <20090603121127.GC1869@ender.fondinvestrk.ru>

On Wednesday 03 June 2009 15:11:28 Afanasov Dmitry wrote:
> On Wed, Jun 03, 2009 at 03:05:27PM +0300, Led wrote:
> > On Wednesday 03 June 2009 14:54:13 Afanasov Dmitry wrote:
> > > On Wed, Jun 03, 2009 at 02:49:35PM +0300, Led wrote:
> > > > On Wednesday 03 June 2009 14:20:01 Dmitry V. Levin wrote:
> > > > > grep 'warning: format not a string literal and no format arguments'
> > > >
> > > > А как правильно предлагается чинить подобное? Я чинил приведением
> > > > типа и/или заменой *printf на puts/fputs - так можно?
> > >
> > > printf(msg) --> printf("%s", msg)
> >
> > ИМХО это костыль
>
> не совсем :)
> http://doc.bughunter.net/format-string/exploit-fs.html
>
> суть - при передаче переменной в качестве формата, нет гарантии, что в
> этой переменное не будет какого-нибудь %p, который заставит printf залезть
> в стек и позволит его переписать: There is the `%n' parameter, which
> writes the number of bytes already printed, into a variable of our choice.

Костыль - использовать функцию для форматирования, если ничего форматировать 
не нужно.

-- 
Led

  reply	other threads:[~2009-06-03 12:19 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-03  1:21 Vitaly Lipatov
2009-06-03  4:15 ` Afanasov Dmitry
2009-06-03  5:41   ` Pavel Solntsev
2009-06-03  7:45 ` Led
2009-06-03  8:28   ` Pavel Solntsev
2009-06-03 10:23     ` Michael Shigorin
2009-06-03 10:32       ` Alexey Rusakov
2009-06-03 10:54 ` Dmitry V. Levin
2009-06-03 11:20   ` Dmitry V. Levin
2009-06-03 11:35     ` Ivan A. Melnikov
2009-06-03 11:49     ` Led
2009-06-03 11:52       ` Slava Semushin
2009-06-03 11:52       ` Damir Shayhutdinov
2009-06-03 11:59         ` Damir Shayhutdinov
2009-06-03 12:07           ` Led
2009-06-03 12:10             ` Damir Shayhutdinov
2009-06-03 12:04         ` Led
2009-06-03 11:54       ` Afanasov Dmitry
2009-06-03 12:05         ` Led
2009-06-03 12:11           ` Afanasov Dmitry
2009-06-03 12:19             ` Led [this message]
2009-06-03 13:12               ` Afanasov Dmitry
2009-06-03 21:23       ` Dmitry V. Levin
2009-06-03 21:14     ` Dmitry V. Levin
2009-06-03 21:30       ` Alexey Tourbin
2009-06-03 21:36         ` Dmitry V. Levin
2009-06-03 22:05         ` Led
2009-06-03 22:45           ` Dmitry V. Levin
2009-06-04  3:13             ` Alexey Tourbin
2009-06-04 20:14               ` Alexey Rusakov
2009-06-04 20:30                 ` Led
2009-06-06 12:42                   ` [devel] [JT] icc (was: Добавление -Werror=format-security) Michael Shigorin
2009-06-06 22:12                     ` Konstantin Pavlov

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=200906031519.43673.ledest@gmail.com \
    --to=ledest@gmail.com \
    --cc=devel@lists.altlinux.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

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git