From: Ralph Boehme Date: Sat, 18 Oct 2025 14:34:00 +0000 (+0200) Subject: smbXsrvdump: catch exception from unparsable records X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ac002d231af82c17e00bd73c91c14842c389fd4;p=thirdparty%2Fsamba.git smbXsrvdump: catch exception from unparsable records Signed-off-by: Ralph Boehme Reviewed-by: Volker Lendecke --- 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()