Bugzilla – Attachment 186456 Details for
Bug 40675
Carriage return in patron note message breaks SIP
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40675: Fix SIP message corruption from embedded line endings
Bug-40675-Fix-SIP-message-corruption-from-embedded.patch (text/plain), 2.26 KB, created by
Martin Renvoize (ashimema)
on 2025-09-16 09:10:06 UTC
(
hide
)
Description:
Bug 40675: Fix SIP message corruption from embedded line endings
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-09-16 09:10:06 UTC
Size:
2.26 KB
patch
obsolete
>From eeaa50b9d551ef642979bc39dbbba6ab592ad40a Mon Sep 17 00:00:00 2001 >From: Bernard Scaife <bernard.scaife@openfifth.co.uk> >Date: Wed, 27 Aug 2025 16:25:25 +0100 >Subject: [PATCH] Bug 40675: Fix SIP message corruption from embedded line > endings > >Patron messages containing carriage returns, line feeds, or CRLF >combinations can break SIP protocol communication since CR is used >as the SIP message terminator. This causes message parsing failures >and protocol errors in self-check systems. > >The previous regex only handled single carriage returns (\r), >missing Windows CRLF (\r\n) and Unix LF (\n) sequences. > >This patch normalizes all line ending variations to spaces to >prevent SIP message corruption while preserving message content. > >Test plan: >1. Go to a patron record and click "Add message" >2. Select "Add message for OPAC..." from dropdown >3. In a text editor (e.g., Word), create a message with line breaks: > "This is line one[Enter]This is line two[Enter]This is line three" >4. Copy and paste this multi-line text into the message box and save >5. Run the SIP emulator: misc/sip_cli_emulator.pl >6. Execute a patron information request for this patron >7. Before patch: Observe message breaks at line endings, corrupting > the SIP response >8. Apply patch and restart SIP server >9. Repeat steps 5-6 >10. After patch: Verify the message appears as single line with > spaces replacing line breaks: "This is line one This is line two > This is line three" >11. Test with different line ending types (Windows, Mac, Unix) to > ensure all variations are handled correctly > >Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> >--- > C4/SIP/Sip.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/C4/SIP/Sip.pm b/C4/SIP/Sip.pm >index c4cff7ee94a..f48a36e97e2 100644 >--- a/C4/SIP/Sip.pm >+++ b/C4/SIP/Sip.pm >@@ -97,8 +97,8 @@ sub add_field { > ); > $value = ''; > } >- $value =~ s/\r/ /g; # CR terminates a sip message >- # Protect against them in sip text fields >+ $value =~ s/\r\n|\r|\n/ /g; # CR terminates a sip message >+ # Protect against them in sip text fields > > # Replace any occurrences of the field delimiter in the > # field value with the HTML character entity >-- >2.51.0
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 40675
:
185583
|
185791
|
185792
|
185793
|
185794
|
185802
|
185833
|
186456
|
186457
|
186608
|
186609
|
186610