Fix issues where a non-zero terminated string would get passed to `parse_user_data`.
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [X] Commit message has the format required by CONTRIBUTING guide
- [X] Commits are split per component (core, individual modules, libs, utils, ...)
- [X] Each component has a single commit (if not, squash them into one commit)
- [X] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [X] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [X] PR should be backported to stable branches
- [X] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3050
-- Commit Summary --
* ims_registrar_scscf: use xmlParseMemory instead of xmlParseDoc
-- File Changes --
M src/modules/ims_registrar_scscf/userdata_parser.c (4)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3050.patchhttps://github.com/kamailio/kamailio/pull/3050.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3050
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3050(a)github.com>
Add the `deregistered` state to IMS_Registrar_events_enum_t, allowing the
registrar to distinguish between UE unregsitration, which do not require
a notification to be sent, and network-originated deregistration requests.
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [X] Commit message has the format required by CONTRIBUTING guide
- [X] Commits are split per component (core, individual modules, libs, utils, ...)
- [X] Each component has a single commit (if not, squash them into one commit)
- [X] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [X] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [ ] PR should be backported to stable branches
- [X] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3051
-- Commit Summary --
* ims_registrar_scscf: add a new contact state for notifications
-- File Changes --
M src/modules/ims_registrar_scscf/registrar_notify.c (5)
M src/modules/ims_registrar_scscf/registrar_notify.h (3)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3051.patchhttps://github.com/kamailio/kamailio/pull/3051.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3051
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3051(a)github.com>
Module: kamailio
Branch: master
Commit: 07b19ef0604a48148f1bb14787516334820e5a3a
URL: https://github.com/kamailio/kamailio/commit/07b19ef0604a48148f1bb1478751633…
Author: Kristiyan Peychev <kristiyan.peychev(a)flolive.net>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-03-11T10:28:22+01:00
ims_registrar_scscf: add a new contact state for notifications
Add the `deregistered` state to IMS_Registrar_events_enum_t, allowing the
registrar to distinguish between UE unregsitration, which do not require
a notification to be sent, and network-originated deregistration requests.
---
Modified: src/modules/ims_registrar_scscf/registrar_notify.c
Modified: src/modules/ims_registrar_scscf/registrar_notify.h
---
Diff: https://github.com/kamailio/kamailio/commit/07b19ef0604a48148f1bb1478751633…
Patch: https://github.com/kamailio/kamailio/commit/07b19ef0604a48148f1bb1478751633…
---
diff --git a/src/modules/ims_registrar_scscf/registrar_notify.c b/src/modules/ims_registrar_scscf/registrar_notify.c
index 761b014624..4dd6223431 100644
--- a/src/modules/ims_registrar_scscf/registrar_notify.c
+++ b/src/modules/ims_registrar_scscf/registrar_notify.c
@@ -495,6 +495,7 @@ int event_reg(udomain_t* _d, impurecord_t* r_passed, ucontact_t* c_passed, int e
//richard: we only use reg unreg expired and refresh
case IMS_REGISTRAR_CONTACT_UNREGISTERED:
+ case IMS_REGISTRAR_CONTACT_DEREGISTERED:
case IMS_REGISTRAR_CONTACT_UNREGISTERED_IMPLICIT:
case IMS_REGISTRAR_CONTACT_REGISTERED:
case IMS_REGISTRAR_CONTACT_REFRESHED:
@@ -1967,7 +1968,8 @@ str get_reginfo_partial(impurecord_t *r, ucontact_t *c, int event_type, unsigned
if (//richard we only use expired and unregistered
(event_type == IMS_REGISTRAR_CONTACT_EXPIRED ||
- event_type == IMS_REGISTRAR_CONTACT_UNREGISTERED)
+ event_type == IMS_REGISTRAR_CONTACT_UNREGISTERED ||
+ event_type == IMS_REGISTRAR_CONTACT_DEREGISTERED)
) {
//check if impu record has any other active contacts - if not then set this to terminated - if so then keep this active
//check if asserted is present in any of the path headers
@@ -2011,6 +2013,7 @@ str get_reginfo_partial(impurecord_t *r, ucontact_t *c, int event_type, unsigned
event = r_expired;
expires = 0;
break;
+ case IMS_REGISTRAR_CONTACT_DEREGISTERED:
case IMS_REGISTRAR_CONTACT_UNREGISTERED:
state = r_terminated;
event = r_unregistered;
diff --git a/src/modules/ims_registrar_scscf/registrar_notify.h b/src/modules/ims_registrar_scscf/registrar_notify.h
index 6bfc6d3ce3..04d4958488 100644
--- a/src/modules/ims_registrar_scscf/registrar_notify.h
+++ b/src/modules/ims_registrar_scscf/registrar_notify.h
@@ -116,7 +116,8 @@ typedef enum {
IMS_REGISTRAR_CONTACT_EXPIRED, /**< A contact has expired and will be removed */
IMS_REGISTRAR_CONTACT_UNREGISTERED, /**< User unregistered with Expires 0 */
IMS_REGISTRAR_CONTACT_UNREGISTERED_IMPLICIT, /**< User unregistered implicitly, ie not via explicit deregister */
- IMS_REGISTRAR_SUBSEQUENT_SUBSCRIBE
+ IMS_REGISTRAR_SUBSEQUENT_SUBSCRIBE,
+ IMS_REGISTRAR_CONTACT_DEREGISTERED, /**< User's registration was terminated with RTR */
} IMS_Registrar_events_enum_t;
extern IMS_Registrar_events_enum_t IMS_Registrar_events;
Module: kamailio
Branch: master
Commit: 0e0bdbf83c7f20bf1814fb58232f8c25e29dd94d
URL: https://github.com/kamailio/kamailio/commit/0e0bdbf83c7f20bf1814fb58232f8c2…
Author: Kristiyan Peychev <kristiyan.peychev(a)flolive.net>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-03-11T10:27:56+01:00
ims_registrar_scscf: use xmlParseMemory instead of xmlParseDoc
Fix issues where a non-zero terminated string would get passed to `parse_user_data`.
---
Modified: src/modules/ims_registrar_scscf/userdata_parser.c
---
Diff: https://github.com/kamailio/kamailio/commit/0e0bdbf83c7f20bf1814fb58232f8c2…
Patch: https://github.com/kamailio/kamailio/commit/0e0bdbf83c7f20bf1814fb58232f8c2…
---
diff --git a/src/modules/ims_registrar_scscf/userdata_parser.c b/src/modules/ims_registrar_scscf/userdata_parser.c
index 4880f0289c..d8b08b5491 100644
--- a/src/modules/ims_registrar_scscf/userdata_parser.c
+++ b/src/modules/ims_registrar_scscf/userdata_parser.c
@@ -916,7 +916,7 @@ static ims_subscription* parse_ims_subscription(xmlDocPtr doc, xmlNodePtr root)
/**
* Parses the user data XML and copies data into a new ims_subscription structure.
- * @param xml - the input xml (NB must be null terminated)
+ * @param xml - the input xml
* @returns the ims_subscription* on success or NULL on error
*/
ims_subscription *parse_user_data(str xml)
@@ -927,7 +927,7 @@ ims_subscription *parse_user_data(str xml)
if (!ctxtInit) parser_init(scscf_user_data_dtd,scscf_user_data_xsd);
doc=0;
- doc = xmlParseDoc((unsigned char *)xml.s);
+ doc = xmlParseMemory((unsigned char *)xml.s, xml.len);
if (!doc){
LM_ERR("This is not a valid XML <%.*s>\n", xml.len,xml.s);
goto error;
…es over TCP
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [ x] Commit message has the format required by CONTRIBUTING guide
- [ x] Commits are split per component (core, individual modules, libs, utils, ...)
- [ x] Each component has a single commit (if not, squash them into one commit)
- [x ] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [x] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3048
-- Commit Summary --
* ims_ipsec_pcscf: fix sha1 algorithm and tcp connections for SIP Replies over TCP
-- File Changes --
M src/modules/ims_ipsec_pcscf/cmd.c (16)
M src/modules/ims_ipsec_pcscf/ipsec.c (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3048.patchhttps://github.com/kamailio/kamailio/pull/3048.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3048
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3048(a)github.com>