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
39cfc56d
Commit
39cfc56d
authored
6 years ago
by
George Joseph
Committed by
Gerrit Code Review
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge "jansson-bundled: Patch for off-nominal crash."
parents
6f3275e5
d9add7e0
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/jansson/patches/0035-Remove-inappropriate-jsonp_free-which-caused-segment.patch
+58
-0
58 additions, 0 deletions
...emove-inappropriate-jsonp_free-which-caused-segment.patch
with
58 additions
and
0 deletions
third-party/jansson/patches/0035-Remove-inappropriate-jsonp_free-which-caused-segment.patch
0 → 100644
+
58
−
0
View file @
39cfc56d
From e262ea5fcd789d20d5d20d5d6d9c7ec06e3c00fd Mon Sep 17 00:00:00 2001
From: Corey Farrell <git@cfware.com>
Date: Mon, 5 Nov 2018 16:43:10 -0500
Subject: [PATCH 35/35] Remove inappropriate jsonp_free which caused
segmentation fault.
pack_string should never free str on error. This wouldn't be a problem
except the check for `ours` was inverted. Just remove the check for
ours since the true condition is unreachable.
json_vpack_ex also had an error check for s.has_error. This can never
be true unless value is NULL.
Test changes removed for merging into Asterisk bundled copy.
Fixes #444
---
src/pack_unpack.c | 9 ++-------
test/suites/api/test_pack.c | 21 +++++++++++++++++++++
2 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/src/pack_unpack.c b/src/pack_unpack.c
index ec04bc3..3b99776 100644
--- a/src/pack_unpack.c
+++ b/src/pack_unpack.c
@@ -359,9 +359,7 @@
static json_t *pack_string(scanner_t *s, va_list *ap)
return t == '?' && !s->has_error ? json_null() : NULL;
if (s->has_error) {
- if (!ours)
- jsonp_free(str);
-
+ /* It's impossible to reach this point if ours != 0, do not free str. */
return NULL;
}
@@ -853,6 +851,7 @@
json_t *json_vpack_ex(json_error_t *error, size_t flags,
value = pack(&s, &ap_copy);
va_end(ap_copy);
+ /* This will cover all situations where s.has_error is true */
if(!value)
return NULL;
@@ -862,10 +861,6 @@
json_t *json_vpack_ex(json_error_t *error, size_t flags,
set_error(&s, "<format>", json_error_invalid_format, "Garbage after format string");
return NULL;
}
- if(s.has_error) {
- json_decref(value);
- return NULL;
- }
return value;
}
--
2.17.2
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