Commit Graph

30129 Commits

Author SHA1 Message Date
Corey Farrell
bb0d22edaa alertpipe: Correct documented return of ast_alertpipe_write.
Change-Id: I4ea49c441890a81384144479dc93ab5a3989486d
2017-11-13 18:48:05 -05:00
Jenkins2
25f7eda3f1 Merge "vectors: Add new macro and a string vector definition." into 15 2017-11-13 17:24:59 -06:00
Jenkins2
51597fe1df Merge "menuselect: Delete and ignore aclocal.m4." into 15 2017-11-13 16:14:51 -06:00
Corey Farrell
f84b2cc417 vectors: Add new macro and a string vector definition.
* AST_VECTOR_STEAL_ELEMENTS - steal the array of elements for use
  with non-vector code.
* struct ast_vector_string - a vector of 'char *'.

Change-Id: I104d1b204be03fccf67e02a195596adcb5ab1e42
2017-11-13 13:38:21 -05:00
Joshua Colp
bcd3782051 Merge "Build System: Disable parallel make in the root Makefile." into 15 2017-11-13 07:46:41 -06:00
Jenkins2
3ee826607d Merge "res_pjsip_pubsub: Ensure remote URI contains URI only." into 15 2017-11-13 06:43:04 -06:00
Corey Farrell
f053360998 menuselect: Delete and ignore aclocal.m4.
This file is temporary output from the bootstrap.sh command, it does not
need to be committed.

Change-Id: Ie0fd113aff6eac44924c0bd0c900833c6c86a6d9
2017-11-11 17:34:38 -05:00
Richard Mudgett
f66a8d6b97 frame.c: Make ast_frame_free()/ast_frfree() NULL tolerant
Change-Id: Ic49d821ef88ada38a31bdd835b9531443c55d793
2017-11-11 14:04:40 -05:00
Jenkins2
6c84a1edd9 Merge "chan_pjsip.c: Fix uninitialized cause value on failure." into 15 2017-11-10 08:03:36 -06:00
Corey Farrell
09afc76a8a core: Remove disabled code.
handle_quit has been disabled since 2003, remove it.

Change-Id: Idc3aaa6c81676160547078f9b71e8aa43de2db18
2017-11-09 21:37:59 -05:00
Jenkins2
11802de2cc Merge "stasis_bridges.c: Fix off-nominal json memory leaks." into 15 2017-11-09 17:44:33 -06:00
Corey Farrell
066d1ab82e Build System: Disable parallel make in the root Makefile.
This ensures that the root Makefile runs only a single target at a time.
SUBMAKE will still honor requested parallelism, so 'make -j8' will build
one directory at a time but allow 8 jobs at once when building a sub
directory.

This will fix some display glitches related to rebuild of XML
documentation.  It will also prevent some edge case errors where
bundled pjproject needs to be rebuild before other parts of Asterisk.

Change-Id: I4f2ec6fbbec1ada0ccb1109a28ea303524239b1e
2017-11-09 14:30:05 -05:00
Kevin Harwell
93b0163f77 Merge "res_pjsip_registrar.c: Fix AOR and pjproject group deadlock." into 15 2017-11-09 11:49:13 -06:00
Richard Mudgett
80c88d9b30 chan_pjsip.c: Fix uninitialized cause value on failure.
Change-Id: I3f9dd3c31bd582e54a30381500077de2319d8cc3
2017-11-09 08:42:22 -05:00
Joshua Colp
7b6f68fe2d Merge "res_pjsip_pubsub: Fix multiple leaks on failure to append vectors." into 15 2017-11-09 03:44:50 -06:00
Joshua Colp
1d25b0ae4a Merge "res_pjsip_history: Fix multiple leaks on vector append failure." into 15 2017-11-09 03:44:30 -06:00
Joshua Colp
f3c383ac5b Merge "res_pjsip_session: Fix multiple leaks." into 15 2017-11-09 03:43:50 -06:00
Joshua Colp
f668cac333 Merge "bridge_softmix: Note why ast_stream_topology_set_stream cannot fail." into 15 2017-11-09 03:42:59 -06:00
Joshua Colp
ed3971d7d8 Merge "res_pjsip_session: Check for errors from ast_stream_topology_set_stream." into 15 2017-11-09 03:42:42 -06:00
Joshua Colp
a2f08746b1 Merge "res_pjsip_t38: Better error checking for t38_create_media_state." into 15 2017-11-08 13:11:34 -06:00
Corey Farrell
28e50b77a8 bridge_softmix: Note why ast_stream_topology_set_stream cannot fail.
This appeared in my audit of ast_stream_topology_set_stream callers
not checking for errors but in this situation the call cannot fail.
Add comment so this can be ignored in the future.

Change-Id: I91d25704859efbe50b8b82cfe1cd3c40ba177c9f
2017-11-08 11:14:06 -05:00
George Joseph
e83995dddf Merge "AST-2017-009: pjproject: Add validation of numeric header values" into 15 2017-11-08 09:52:38 -06:00
George Joseph
72ca462758 Merge "AST-2017-011 - res_pjsip_session: session leak when a call is rejected" into 15 2017-11-08 09:45:01 -06:00
George Joseph
4392cc4a61 Merge "AST-2017-010: Fix cdr_object_update_party_b_userfield_cb() buf overrun" into 15 2017-11-08 08:26:58 -06:00
Jenkins2
85057a9ee5 Merge "res_pjproject.c: Fix ast_strdup() alloc failure." into 15 2017-11-08 07:39:02 -06:00
Kevin Harwell
1fe507a237 AST-2017-011 - res_pjsip_session: session leak when a call is rejected
A previous commit made it so when an invite session transitioned into a
disconnected state destruction of the Asterisk pjsip session object was
postponed until either a transport error occurred or the event timer
expired. However, if a call was rejected (for instance a 488) before the
session was fully established the event timer may not have been initiated,
or it was canceled without triggering either of the session finalizing states
mentioned above.

Really the only time destruction of the session should be delayed is when a
BYE is being transacted. This is because it's possible in some cases for the
session to be disconnected, but the BYE is still transacting.

This patch makes it so the session object always gets released (no more
memory leak) when the pjsip session is in a disconnected state. Except when
the method is a BYE. Then it waits until a transport error occurs or an event
timeout.

ASTERISK-27345 #close

Reported by: Corey Farrell

Change-Id: I1e724737b758c20ac76d19d3611e3d2876ae10ed
2017-11-08 05:49:21 -07:00
Richard Mudgett
5f501b339e AST-2017-010: Fix cdr_object_update_party_b_userfield_cb() buf overrun
cdr_object_update_party_b_userfield_cb() could overrun the fixed buffer if
the supplied string is too long.  The long string could be supplied by
external means using the CDR(userfield) function.

This may seem reminiscent to AST-2017-001 (ASTERISK_26897) and it is.  The
earlier patch fixed the buffer overrun for Party A's userfield while this
patch fixes the same thing for Party B's userfield.

ASTERISK-27337

Change-Id: I0fa767f65ecec7e676ca465306ff9e0edbf3b652
2017-11-08 05:40:34 -07:00
George Joseph
a1f21934b7 AST-2017-009: pjproject: Add validation of numeric header values
Parsing the numeric header fields like cseq, ttl, port, etc. all
had the potential to overflow, either causing unintended values to
be captured or, if the values were subsequently converted back to
strings, a buffer overrun.  To address this, new "strto" functions
have been created that do range checking and those functions are
used wherever possible in the parser.

 * Created pjlib/include/limits.h and pjlib/include/compat/limits.h
   to either include the system limits.h or define common numeric
   limits if there is no system limits.h.

 * Created strto*_validate functions in sip_parser that take bounds
   and on failure call the on_str_parse_error function which prints
   an error message and calls PJ_THROW.

 * Updated sip_parser to validate the numeric fields.

 * Fixed an issue in sip_transport that prevented error messages
   from being properly displayed.

 * Added "volatile" to some variables referenced in PJ_CATCH blocks
   as the optimizer was sometimes optimizing them away.

 * Fixed length calculation in sip_transaction/create_tsx_key_2543
   to account for signed ints being 11 characters, not 9.

ASTERISK-27319
Reported by: Youngsung Kim at LINE Corporation

Change-Id: I48de2e4ccf196990906304e8d7061f4ffdd772ff
2017-11-08 05:25:40 -07:00
Joshua Colp
85155b3cf5 Merge "res_pjsip_exten_state: Check for vector append failure." into 15 2017-11-08 04:59:08 -06:00
Joshua Colp
33e42b2067 Merge "res_stasis: Fix multiple leaks." into 15 2017-11-08 04:57:13 -06:00
Joshua Colp
37afdcde2c Merge "res_pjsip_outbound_registration: Fix leak on vector add failure." into 15 2017-11-08 04:56:50 -06:00
Jenkins2
1f09784d28 Merge "res_pjsip: Avoid crash when contact uri is empty string" into 15 2017-11-08 00:14:13 -06:00
Jenkins2
446b3ea862 Merge "res_pjsip: Fix leak on error in ast_sip_auth_vector_init." into 15 2017-11-07 22:34:47 -06:00
Jenkins2
82f85f954e Merge "stream: Return error from ast_stream_topology_set_stream." into 15 2017-11-07 21:50:52 -06:00
Corey Farrell
a7d21fec65 res_pjsip_pubsub: Fix multiple leaks on failure to append vectors.
Change-Id: I68ece0073ea79667ca41eb10405f516f1d30d482
2017-11-07 22:38:00 -05:00
Corey Farrell
a03f200358 res_pjsip_history: Fix multiple leaks on vector append failure.
Change-Id: I41e8d5183ace284095cc721f3b1fb32ade3f940f
2017-11-07 22:31:02 -05:00
Corey Farrell
31244fc277 res_pjsip_session: Fix multiple leaks.
* Pre-initialize cloned media state vectors to final size to ensure
  vector errors cannot happen later in the clone initialization.
* Release session_media on vector replace failure in
  ast_sip_session_media_state_add.
* Release clone and media_state in ast_sip_session_refresh if we fail to
  append to the stream topology, return an error.

Change-Id: Ib5ffc9b198683fa7e9bf166d74d30c1334c23acb
2017-11-07 22:26:34 -05:00
Jenkins2
43d450c58b Merge "res_pjsip_config_wizard: Fix leaks and add check for malloc failure." into 15 2017-11-07 19:22:02 -06:00
Joshua Colp
1f86ddeaa9 Merge "res_stasis_playback: Check for failure to append vector." into 15 2017-11-07 18:41:42 -06:00
Joshua Colp
33db2eefe5 Merge "CLI: Remove unused internal command." into 15 2017-11-07 18:31:46 -06:00
Jenkins2
410872b8ef Merge "test_sorcery_memory_cache_thrash: Handle error from vector append." into 15 2017-11-07 17:22:43 -06:00
Joshua Colp
d1d793d411 Merge "stasis: Release object if vector append fails." into 15 2017-11-07 16:37:15 -06:00
Joshua Colp
d253092064 Merge "Messaging: Report error on failure to register tech or handler." into 15 2017-11-07 16:05:56 -06:00
Joshua Colp
0553ee1b9e Merge "res_ari_events: Fix use after free / double-free of JSON message." into 15 2017-11-07 15:59:42 -06:00
Joshua Colp
afc53cbe1c Merge "PBX: Handle errors from AST_VECTOR_APPEND." into 15 2017-11-07 15:23:21 -06:00
Jenkins2
6cf44ee48e Merge "format_cap: Fix leak on AST_VECTOR_APPEND error." into 15 2017-11-07 14:09:15 -06:00
Richard Mudgett
de656d8c66 res_pjsip_registrar.c: Fix AOR and pjproject group deadlock.
One of the patches for ASTERISK_27147 introduced a deadlock regression.
When the connection oriented transport shut down, the code attempted to
remove the associated contact.  However, that same transport had just
requested a registration that we hadn't responded to yet.  Depending
upon timing we could deadlock.

* Made send the REGISTER response after we completed processing the
request contacts and released the AOR lock to avoid the deadlock.

ASTERISK-27391

Change-Id: I89a90f87cb7a02facbafb44c75d8845f93417364
2017-11-07 13:01:15 -05:00
Joshua Colp
aa52a18e67 Merge "res_pjsip: Ignore empty TLS configuration" into 15 2017-11-07 11:51:05 -06:00
Corey Farrell
17136aacc0 res_pjsip_session: Check for errors from ast_stream_topology_set_stream.
Free memory and return error if ast_stream_topology_set_stream fails.

Change-Id: I9f4dbf44bed627243d2f1dd8aea2eab6c38a028d
2017-11-07 12:41:02 -05:00
Corey Farrell
dd73524bf6 res_pjsip_t38: Better error checking for t38_create_media_state.
Change-Id: I81b2587427c6982aa3e2a3f9ad69cce8d316eb10
2017-11-07 12:36:47 -05:00