1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-09 09:57:48 +03:00

CVE-2020-10730: vlv: Another workaround for mixing ASQ and VLV

This is essentially an alternative patch, but without the correct
behaviour.  Instead this just avoids a segfault.

Included in case we have something simialr again in
another module.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14364

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
This commit is contained in:
Andrew Bartlett 2020-05-05 16:34:11 +12:00 committed by Karolin Seeger
parent ec1c7d6208
commit ff0b1df856

View File

@ -442,10 +442,21 @@ static int vlv_results(struct vlv_context *ac)
ret = vlv_search_by_dn_guid(ac->module, ac, &result, guid,
ac->req->op.search.attrs);
if (ret == LDAP_NO_SUCH_OBJECT) {
/* The thing isn't there, which we quietly
ignore and go on to send an extra one
instead. */
if (ret == LDAP_NO_SUCH_OBJECT
|| result->count != 1) {
/*
* The thing isn't there, which we quietly
* ignore and go on to send an extra one
* instead.
*
* result->count == 0 or > 1 can only
* happen if ASQ (which breaks all the
* rules) is somehow invoked (as this
* is a BASE search).
*
* (We skip the ASQ cookie for the
* GUID searches)
*/
if (last_i < ac->store->num_entries - 1) {
last_i++;
}