svn commit: samba r23284 - in branches/SAMBA_3_0/source/nsswitch: .

2007-05-31 Thread obnox
Author: obnox
Date: 2007-05-31 23:58:56 + (Thu, 31 May 2007)
New Revision: 23284

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23284

Log:
Oh what a nasty typo! This gave me some headache,
with talloc randomly failing.

Hey, shouldn't TALLOC_ARRAY _not_ return NULL when
requested to allocate an array with zero entries? :-)

Michael


Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd_ads.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_ads.c
===
--- branches/SAMBA_3_0/source/nsswitch/winbindd_ads.c   2007-05-31 23:55:37 UTC 
(rev 23283)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_ads.c   2007-05-31 23:58:56 UTC 
(rev 23284)
@@ -975,7 +975,7 @@
 * we try to resolve as many sids as possible from the
 * cache. Only the rest is passed to the lsa_lookup_sids call. */

-   if (num_names) {
+   if (num_members) {
(*sid_mem) = TALLOC_ZERO_ARRAY(mem_ctx, DOM_SID, num_members);
(*names) = TALLOC_ZERO_ARRAY(mem_ctx, char *, num_members);
(*name_types) = TALLOC_ZERO_ARRAY(mem_ctx, uint32, num_members);



Re: svn commit: samba r23284 - in branches/SAMBA_3_0/source/nsswitch: .

2007-05-31 Thread Jeremy Allison
On Thu, May 31, 2007 at 11:58:57PM +, [EMAIL PROTECTED] wrote:
 Author: obnox
 Date: 2007-05-31 23:58:56 + (Thu, 31 May 2007)
 New Revision: 23284
 
 WebSVN: 
 http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23284
 
 Log:
 Oh what a nasty typo! This gave me some headache,
 with talloc randomly failing.
 
 Hey, shouldn't TALLOC_ARRAY _not_ return NULL when
 requested to allocate an array with zero entries? :-)

Yes it should at the moment. It should be calling
_talloc_array_zeronull() under the covers in lib/util.c
which explicitly does this.

Was this not happening for you ? I'd like you to
debug that as I can't see a codepath for this not
to happen.

Jeremy.