Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
b304c97d
Commit
b304c97d
authored
7 years ago
by
Jenkins2
Committed by
Gerrit Code Review
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge "pjproject_bundled: Prevent crash on bad outgoing header"
parents
ee893774
f0a3c977
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
third-party/pjproject/patches/0060-sip_msg-Prevent-crash-on-header-without-vptr.patch
+47
-0
47 additions, 0 deletions
...s/0060-sip_msg-Prevent-crash-on-header-without-vptr.patch
with
47 additions
and
0 deletions
third-party/pjproject/patches/0060-sip_msg-Prevent-crash-on-header-without-vptr.patch
0 → 100644
+
47
−
0
View file @
b304c97d
From cf6b662b8fe450ea7dc6eb5adb2b878971ce0d67 Mon Sep 17 00:00:00 2001
From: George Joseph <gjoseph@digium.com>
Date: Wed, 10 Jan 2018 08:48:32 -0700
Subject: [PATCH] sip_msg: Prevent crash on header without vptr
Occasionally a header with no vptr gets into the list of header. This
causes a crash when printing them. We still need to figure out how
the header got there but this patch at least prevents the crash by checking
for a non-NULL vptr before attempting to call its print function.
---
pjsip/src/pjsip/sip_msg.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/pjsip/src/pjsip/sip_msg.c b/pjsip/src/pjsip/sip_msg.c
index 76d07b563..194b5ee01 100644
--- a/pjsip/src/pjsip/sip_msg.c
+++ b/pjsip/src/pjsip/sip_msg.c
@@ -26,6 +26,7 @@
#include <pj/string.h>
#include <pj/pool.h>
#include <pj/assert.h>
+#include <pj/log.h>
#include <pjlib-util/string.h>
PJ_DEF_DATA(const pjsip_method) pjsip_invite_method =
@@ -469,6 +470,8 @@
PJ_DEF(pj_ssize_t) pjsip_msg_print( const pjsip_msg *msg,
*p++ = '\r';
*p++ = '\n';
+ } else {
+ PJ_LOG(1, ("sip_msg", "Header with no vptr encountered!! Current buffer: %.*s", (int)(p-buf), buf));
}
}
@@ -576,6 +579,9 @@
PJ_DEF(void*) pjsip_hdr_shallow_clone( pj_pool_t *pool, const void *hdr_ptr )
PJ_DEF(int) pjsip_hdr_print_on( void *hdr_ptr, char *buf, pj_size_t len)
{
pjsip_hdr *hdr = (pjsip_hdr*) hdr_ptr;
+ if (!hdr->vptr) {
+ return 0;
+ }
return (*hdr->vptr->print_on)(hdr_ptr, buf, len);
}
--
2.14.3
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment