From 6ac002d231af82c17e00bd73c91c14842c389fd4 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Sat, 18 Oct 2025 16:34:00 +0200 Subject: [PATCH] smbXsrvdump: catch exception from unparsable records Signed-off-by: Ralph Boehme Reviewed-by: Volker Lendecke --- examples/scripts/debugging/smbXsrvdump | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/scripts/debugging/smbXsrvdump b/examples/scripts/debugging/smbXsrvdump index f5c3091dc0d..30bf1a57b9f 100755 --- a/examples/scripts/debugging/smbXsrvdump +++ b/examples/scripts/debugging/smbXsrvdump @@ -47,8 +47,15 @@ def print_record(data, ndr_type, watched, ctdb): print_watchers(num_watched, blob) blob = blob[num_watched*4:] - unpacked = ndr_unpack(ndr_type, blob, allow_remaining=True) - print(ndr_print(unpacked)) + try: + unpacked = ndr_unpack(ndr_type, blob, allow_remaining=True) + except Exception: + unpacked = None + pass + if unpacked is not None: + print(ndr_print(unpacked)) + else: + print("") if __name__ == "__main__": parser = argparse.ArgumentParser() -- 2.47.3