Commit Graph

213 Commits

Author SHA1 Message Date
Andrey Volk 97f42d429f FS-11505: [core] System call with output capture on Linux and Windows without fork. Add switch_core test. 2018-12-20 10:19:27 -05:00
Brian West 3563ec1e63 FS-10946: [core] Duplicate code in switch_xml.c #resolve 2018-07-24 07:21:48 +00:00
Seven Du 4719d04706 FS-10918 #resolve 2018-07-24 07:21:48 +00:00
Anthony Minessale 1064bb043c FS-10784: [freeswitch-core] Make Users lists compatible with all forms of xml #resolve 2018-07-24 07:21:33 +00:00
Marc Olivier Chouinard 0147d4dbc1 FS-10112: switch_xml - Renaming a C variable name and type (No behavior change) 2017-03-08 16:41:12 -05:00
Sergey Safarov df1ab07ca4 FS-9924: Removed extra space in source files 2017-02-09 23:59:49 -05:00
Brian West 1b13e15919 FS-9693 revert 2016-11-03 11:03:10 -05:00
François 6e4e48c6be FS-9693 use local time instead of utc for date-time comparison 2016-11-03 15:53:02 +01:00
Ken Rice a80c67e375 FS-8818 #resolve refactor X-PRE include to not toss error if there are not files that match the include 2016-02-09 16:38:47 -06:00
Anthony Minessale 350a739da8 FS-8650 #resolve [Add switch_must_malloc/switch_must_realloc/switch_must_strdup and use it in switch_xml.c] 2015-12-11 16:57:30 -06:00
Anthony Minessale af5281e91d revert commit from PR 585 2015-12-11 16:30:45 -06:00
Peter Wu 48d6a5f6a8 switch_xml_decode: avoid NUL injection
strtol can parse negative values which opens the hole for a NUL
injection. The (invalid) entity "&#-256;" is parsed as 0xFFFFFF00 which
(when casted to a char) becomes 0.

Avoid this attack by using unsigned long integers. To avoid undefined
behavior due to negative shifts, restrict the upper bound of the code
points to the UTF-8 limits. (Add an assertion to make the Clang static
analyzer happy.)

Note: due to the specification of strtol, leading spaces and minus/plus
signs are also allowed, explicitly check for an integer. "&#0x1;" is
still accepted, but that is considered a minor issue.
2015-11-08 18:32:04 +01:00
Peter Wu b683199688 switch_xml_set_attr: fix inconsistent state on error paths
Partially rewrite switch_xml_set_attr to fix memory leaks, uninitialized
argument values and use-after free warnings from Clang static analyzer.

Fixes these problems:

 - Add some comments and a new variable such that the code can more
   easily be audited / understood.
 - Always clear SWITCH_XML_DUP flag even if an error occurred to prevent
   free()'ing static strings on future invocations.
 - Keep the attribute list in a consistent state even if one of the
   memory allocation fails.
 - Keep allocation metadata in a consistent state when shrinking of the
   attribute lists fails. Previously the metadata was not updated,
   resulting in a wrong mapping from attributes to allocation flags.
 - Fix memory leaks when allocations fail.

Previous behavior: invalid memory accesses are possible after a memory
allocation failure, previous attributes may be lost.
New behavior: attributes list is always valid, a new attribute is either
set (or not), attributes can always be removed.
2015-11-08 18:30:44 +01:00
Michael Jerris d8e7897f1e FS-8185: [core] Allow xml preprocessor to expand variables where the resulting value is much longer than the original size 2015-09-17 22:04:58 -05:00
Luis Azedo 4dc7b3b246 FS-7760 #resolve
added xml fetch for channels to externally support nightmare transfer
depends on channel-xml-fetch-on-nightmare-transfer profile param (default is disabled)

fixes missing entry in switch_xml.c to enable the xml binding
2015-07-09 20:00:28 +01:00
Travis Cross 959e672a94 Fix spelling "Couldnt" -> "Couldn't" 2014-08-22 02:19:45 +00:00
William King bdbefdcc48 CID:1087631 In the unlikely case the sprintf fails, free the memory instead of leak it 2014-05-14 19:56:32 -07:00
Anthony Minessale 287fd66800 FS-6403 --resolve
This commit also reverts 2 previous attempts to fix this very rare race issue spanning back to 2009

62ce853897 Patch from MOC
3a85348cdf FS-2302 mutex added around switch_xml_toxml()

The real problem was switch_xml_toxml_buf() was actually temporarily modifying the xml structure being searialized to make it appaer to be a root structure then serializing it and restoring the pointers.  This caused a non-threadsafe operation when some other thread was scanning the same xml structure.

This patch removes the modification and instead passes a new arg to switch_xml_toxml_r indicating to treat the structure as if it were a root structure.

This bug has been present since the induction of xml into FS.
2014-04-03 20:30:45 +05:00
Anthony Minessale 7151d6acea FS-6402 part 2 2014-04-02 03:21:37 +05:00
Jeff Lenk 69cc7014e4 FS-6355 remove check on delete 2014-03-15 23:09:45 -05:00
Jeff Lenk 586b189166 FS-6355 fix for windows delete file 2014-03-15 18:01:03 -05:00
Brian West f087248cfc FS-6355 - Patch to have .fsxml file be generated atomic to avoid partial reads when using this file to compare to previous versions/etc. 2014-03-13 17:27:36 -05:00
Anthony Minessale 804ef7709d change from sqlite hash to newly added one 2014-03-09 00:37:17 +05:00
Travis Cross 9cf864ba2b Deal with read errors in switch_xml.c
Unlike fread(3), read(3) will return -1 on error.  We were assigning
the result of read to a potentially unsigned variable, and passing the
result down to switch_xml_parse_str() where it would end up
determining how many bytes to malloc(3).
2014-02-28 18:33:31 +00:00
Anthony Minessale 15b8dfa8af FS-6217 --resolve 2014-02-13 06:22:13 +05:00
Ken Rice 6e7d5d0897 update copyright header for 2014 2014-02-12 12:08:56 -06:00
Anthony Minessale 87c5c64c32 FS-6032 2013-12-09 22:14:38 +05:00
Anthony Minessale 726b607667 FS-5841 --resolve 2013-11-22 22:52:59 +05:00
Anthony Minessale 1780e22805 FS-5779 --resolve 2013-09-12 09:27:06 +05:00
Anthony Minessale bd41ecc396 FS-5779 --resolve 2013-09-12 01:29:32 +05:00
Anthony Minessale 32437d0412 FS-5747 move reloadxml event outside of mutex 2013-09-05 04:09:53 +05:00
Anthony Minessale 5b8a1337d6 FS-5734 documentation will need to be updated to request languages instead of phrases 2013-08-28 21:25:35 +05:00
Anthony Minessale f08c3309f6 FS-5621 2013-07-20 14:07:01 -05:00
Anthony Minessale a6bffd38cb FS-5498 2013-07-19 12:03:51 -05:00
Ken Rice 2f48c63107 Revert "FS-5567 --resolve"
pulling this one for a bit...

This reverts commit 518b5a802e.
2013-07-11 12:04:12 -05:00
Ken Rice 518b5a802e FS-5567 --resolve 2013-07-11 11:10:11 -05:00
Ken Rice f30e40a80b --resolve FS-3922 2013-07-04 21:18:20 -05:00
Nathan Neulinger 32adc789f6 make noexpandtab explicit in all vim modelines other than xml files 2013-06-25 11:50:17 -05:00
Raymond Chandler 610718fdff FS-4871: reduce logging a bit 2013-05-23 20:51:25 -04:00
Jeff Lenk 0bf912e821 FS-5389 2013-05-08 11:36:13 -05:00
Jeff Lenk ab7ae9f7cc FS-5389 --resolve 2013-05-08 08:37:10 -05:00
Raymond Chandler a2fcb4191e FS-4871 --resolve 2013-05-07 15:07:04 -04:00
Anthony Minessale bf607b0d91 FS-5319 --resolve 2013-04-17 15:33:27 -05:00
Jeff Lenk 16289ce9a4 FS-5166 --resolve exec for windows 2013-03-13 22:24:25 -05:00
Brian West f4e55fb187 fix regression from 6b6c83a718 2012-11-13 12:48:59 -06:00
Anthony Minessale a4a44fb140 FS-4741 parse timezone variable and adjust time for time based routing 2012-10-31 10:43:59 -05:00
Anthony Minessale 6d7e2799c3 FS-4741 I think I see the issue, try this 2012-10-31 11:41:48 -04:00
Anthony Minessale 01dde19cbd FS-4741 --resolve use paypal@freeswitch.org 2012-10-23 18:19:32 -04:00
Anthony Minessale 30a13ca0c6 FS-4728 --resolve got it, related to multpile bindings 2012-10-17 12:29:50 -04:00
Jeff Lenk 6b6c83a718 FS-2746 --resolve large xmlrpc update thanks garmt 2012-10-13 11:37:25 -05:00