[lkml]   [2011]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] flex_array: Change behaviour on zero size allocations
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.


 \ /
  Last update: 2011-02-02 08:57    [W:0.031 / U:15.824 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site