[PATCH] Fix ldb_comparison_binary for blobs of differing lengths

Garming Sam garming at catalyst.net.nz
Tue Jan 12 03:25:45 UTC 2016


Recently Douglas and I have been investigating sorting issues and come 
across an issue with ldb_comparison_binary. In the case of two ldb_vals 
of the same length, the function produced the correct functionality. 
However, in the case of differing lengths, the function with simply 
return the shorter of the two (disregarding the contents completely).

In terms of how the error came to be, the function appears to be based 
on another which was intended to return either a YES or NO answer on 
whether or not two values were the same. The problem being that the 
function was then used as a standard comparison function for sorting.

Attached is the patch to fix the issue. As far as consequences of the 
error go, I'm not entirely sure what it actually broke at this point. 
Besides the obvious sort module, it was a default/fallback sort method 
and used in a few other places. A full make test is currently running to 
see if it breaks autobuild.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-ldb-make-ldb_comparison_binary-compare-binary.patch
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160112/c890d52a/0001-ldb-make-ldb_comparison_binary-compare-binary.patch>

More information about the samba-technical mailing list