netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Jan Engelhardt <jengelh@computergmbh.de>
Cc: Petr Pisar <petr.pisar@atlas.cz>,
	netfilter@vger.kernel.org,
	Netfilter Development Mailinglist
	<netfilter-devel@vger.kernel.org>
Subject: Re: [ANNOUNCE] Release of iptables 1.4.0rc1
Date: Wed, 17 Oct 2007 10:38:28 +0200	[thread overview]
Message-ID: <4715CA04.9080708@trash.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0710161659080.10197@fbirervta.pbzchgretzou.qr>

Jan Engelhardt wrote:
> On Oct 16 2007 10:44, Patrick McHardy wrote:
>>
>> static int parse_counters(char *string, struct ip6t_counters *ctr)
>> {
>> -	return (sscanf(string, "[%llu:%llu]", (unsigned long long *)&ctr->pcnt, (unsigned long long *)&ctr->bcnt) == 2);
>> +	u_int64_t *pcnt, *bcnt;
>> +
>> +	pcnt = &ctr->pcnt;
>> +	bcnt = &ctr->bcnt;
>> +	return (sscanf(string, "[%llu:%llu]", (unsigned long long *)pcnt, (unsigned long long *)bcnt) == 2);
>> }
> 
> This is also wrong (even though it may work in practice), since unsigned long
> long does not necessarily need to be 64 bit (it may be larger, and if so,
> you'll smash the stack).
> What you want is:


Indeed, that is obviously wrong. I'll fix that and the other occurences.

      reply	other threads:[~2007-10-17  8:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-15 16:52 [ANNOUNCE] Release of iptables 1.4.0rc1 Pablo Neira Ayuso
     [not found] ` <slrnfh7f7l.crr.petr.pisar@album.ics.muni.cz>
2007-10-16  8:44   ` Patrick McHardy
2007-10-16 14:30     ` Petr Pisar
2007-10-17  8:48       ` Patrick McHardy
2007-10-16 15:01     ` Jan Engelhardt
2007-10-17  8:38       ` Patrick McHardy [this message]

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=4715CA04.9080708@trash.net \
    --to=kaber@trash.net \
    --cc=jengelh@computergmbh.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=netfilter@vger.kernel.org \
    --cc=petr.pisar@atlas.cz \
    /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).