From 1b7d72acfb3675660aa22c63d66f24ed116ada9b Mon Sep 17 00:00:00 2001
From: Rob Swindell <rob@synchro.net>
Date: Mon, 9 May 2022 18:52:27 -0700
Subject: [PATCH] Remove trailing whitespace before computing Subject CRC

Some responding programs will automatically remove the trailing white-space from subject when replying and that would mess up the subject-linkage-by-CRC. So let's just ignore trailing whitespace in the first place.
---
 src/smblib/smbhash.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/smblib/smbhash.c b/src/smblib/smbhash.c
index e884c5235b..3e6198a3a1 100644
--- a/src/smblib/smbhash.c
+++ b/src/smblib/smbhash.c
@@ -387,6 +387,7 @@ uint16_t smb_subject_crc(const char* subj)
 		return(0xffff);
 
 	strlwr(str);
+	truncsp(str);
 	crc=crc16(str,0	/* auto-length */);
 	free(str);
 
-- 
GitLab