Bugzilla – Attachment 193165 Details for
Bug 41811
SIP server will inadvertently remove non-alphanumeric characters from the end of a message
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41811: SIP server will inadvertently remove non-alphanumeric characters from the end of a message
aaf178c.patch (text/plain), 2.33 KB, created by
David Nind
on 2026-02-15 02:08:41 UTC
(
hide
)
Description:
Bug 41811: SIP server will inadvertently remove non-alphanumeric characters from the end of a message
Filename:
MIME Type:
Creator:
David Nind
Created:
2026-02-15 02:08:41 UTC
Size:
2.33 KB
patch
obsolete
>From aaf178cdcfa14ed47cb13029eca71b601d2c7b8a Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 10 Feb 2026 14:06:08 -0500 >Subject: [PATCH] Bug 41811: SIP server will inadvertently remove > non-alphanumeric characters from the end of a message > >If a message ends in a non-alphanumeric character, that character is stripped from the message. > >For example: >6300120260210 182641 AOMPL|AA23529000035676(| > >64 00120260210 182831000000000000000000000000AOCPL|AA23529000035676|AEHenry Acevedo|BLY|BHUSD|BV0|CC5|BD4345 Library Rd. Springfield, MA 44224|BF(212) 555-1212|PB19580530|PCS|PIY|AFGreetings from Koha. | > >versus: >6300120260210 182641 AOMPL|AA23529000035676(|ACkoha| > >64YYYY 00120260210 182835000000000000000000000000AOCPL|AA23529000035676(|AE|BLN|AFInvalid cardnumber| > >The former should be returning the same "Invalid cardnumber" message the latter does. > >Test Plan ( assumes you are using KTD ): >1) Install telnet: sudo apt install -y telnet >2) telnet 127.0.0.1 6001 >3) Log in with: 9300CNkoha|COkoha|CPMPL| >4) Send the patron information request: 6300120260210 183346 AOMPL|AA23529000035676(| >5) Note you get a patron back >6) Apply this patch >7) Restart SIP! >8) Repeat steps 2-5 >9) Noe you doe not get a patron back in the response! > >Signed-off-by: David Nind <david@davidnind.com> >--- > C4/SIP/SIPServer.pm | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > >diff --git a/C4/SIP/SIPServer.pm b/C4/SIP/SIPServer.pm >index 5801db7c03..0939478349 100644 >--- a/C4/SIP/SIPServer.pm >+++ b/C4/SIP/SIPServer.pm >@@ -588,8 +588,11 @@ sub read_request { > $raw_length = length $buffer; > $buffer =~ s/^\s*[^A-z0-9]+//s; > >- # Every line must start with a "real" character. Not whitespace, control chars, etc. >- $buffer =~ s/[^A-z0-9]+$//s; >+ # Remove leading/trailing control characters and whitespace. >+ # SIP2 messages should be a single printable line; this defensively >+ # cleans up stray CR/LF or junk from buggy or long-lived client connections. >+ $buffer =~ s/^[[:cntrl:]\s]+//; >+ $buffer =~ s/[[:cntrl:]\s]+$//; > > # Same for the end. Note this catches the problem some clients have sending empty fields at the end, like ||| > $buffer =~ s/\015?\012//g; # Extra line breaks must die >-- >2.39.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41811
:
192933
| 193165