Bug 10347 - Failure in partition_start_trans results in infinite loops
Failure in partition_start_trans results in infinite loops
Status: ASSIGNED
Product: Samba 4.1 and newer
Classification: Unclassified
Component: AD: LDB/DSDB/SAMDB
unspecified
All All
: P5 normal
: ---
Assigned To: Andrew Bartlett
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-25 16:35 UTC by herwin
Modified: 2016-07-29 08:02 UTC (History)
3 users (show)

See Also:
mdw: review+


Attachments
patch (679 bytes, patch)
2013-12-25 16:36 UTC, herwin
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description herwin 2013-12-25 16:35:17 UTC
A short overview of the function:

  unsigned int i;
  ... i gets a value
  ret = ldb_next_start_trans(data->partitions[i]->module);
    if (ret != LDB_SUCCESS) {
      for (i--; i >= 0; i--) {
        .. do something with i
      }
    }

Since i is unsigned, the condition "i >= 0" is always true. The attached patch fixes this bug.
Comment 1 herwin 2013-12-25 16:36:00 UTC
Created attachment 9549 [details]
patch
Comment 2 Matthias Dieter Wallnöfer 2013-12-25 16:47:08 UTC
yes, this seems correct.