LKML Archive on
help / color / mirror / Atom feed
From: Steffen Klassert <>
To: Eric Paris <>
Cc: Dave Hansen <>,
	Andrew Morton <>,,
Subject: Re: [PATCH] flex_array: Change behaviour on zero size allocations
Date: Wed, 2 Feb 2011 08:55:20 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <1296573623.3145.6.camel@localhost.localdomain>

On Tue, Feb 01, 2011 at 10:20:22AM -0500, Eric Paris wrote:
> I'm fine with any solution.  It's obviously broken for SELinux to be
> passing -1 even if the library supported it.  I guess I don't really
> have strong feelings on how to fix it.
> 1) make end exclusive
> 2) change 'end' to 'len'
> 3) just make selinux not prealloc() when the #elements == 0
> All seem perfectly reasonable to me, but I'd probably do them in that
> order.

I think I would prefer option 2. Passing a size or a length to
a memory allocator is quite common and we would not need to care
for bugs where 'end' is smaller than 'start'.

So I'd do it like that, if noone has strong feelings for another option.


      reply	other threads:[~2011-02-02  7:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-31  8:52 Steffen Klassert
2011-01-31 16:31 ` Dave Hansen
2011-02-01 10:24   ` Steffen Klassert
2011-02-01 11:03     ` Steffen Klassert
2011-02-01 14:55       ` Dave Hansen
2011-02-01 15:20         ` Eric Paris
2011-02-02  7:55           ` Steffen Klassert [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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] flex_array: Change behaviour on zero size allocations' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).