LDB: Patch for fixing counter variables
Matthias Dieter Wallnöfer
mdw at samba.org
Fri Nov 6 14:19:46 MST 2009
Most of our LDB objects are stored in structures containing a dynamic array and a counter. The counter variable is typically an "unsigned integer". Until here it's all okay. But with the major part of the counter variables (i, j...) it's not: since they're "signed". Well, this doesn't give problems till we don't break the ~ 2,1 * 10^9 barrier - but the API is fine to go beyond: with the possible result of infinite loops (since we are never able to reach the maximum).
Now you can argue: "this does happen very rarely" - where I'm also with you. But that doesn't mean that those counters aren't buggy. Since the LDB is a public library for LDAP-like directories I would be very pleased to see this fixed.
To achieve this I prepared a patch which changes "signed" types to "unsigned" ones which fix the problem. It passes "make test" and doesn't seem to give problems. The only thing I would like to ask you is to review it, so I could push it soon.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 48943 bytes
Desc: not available
More information about the samba-technical