s4:dsdb/paged_results: fix segfault in paged_results()
authorStefan Metzmacher <metze@samba.org>
Wed, 19 Jan 2022 14:57:08 +0000 (15:57 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 20 Jan 2022 09:10:28 +0000 (09:10 +0000)
commit19fa22b1fbcf33dbc4defe4dd2e487a642786c49
tree610e5613ed1b8c6cc1fd0b65b05ec79269e36fec
parent7055827b8ffd3823c1240ba3f0b619dd6068cd51
s4:dsdb/paged_results: fix segfault in paged_results()

It can happen that the paged_results() failes, e.g. due to
LDB_ERR_TIME_LIMIT_EXCEEDED, if that happens we should not
dereference ares->response, if ares is NULL.

We also should not call ldb_module_done() if paged_results()
fails, as it was already called.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source4/dsdb/samdb/ldb_modules/paged_results.c