Jakub Karolczyk
bb9afcb388
[core] Coverity fixes
...
* [core] Coverity 1518099, 1518097, 1518098 (Unchecked return value from library)
* [core] Coverity 1468551 Unchecked return value
* [core] Coverity 1468293 Unchecked return value
* [core] Coverity 1468274 Explicit null dereferenced
* [core] Coverity 1395588 Unchecked return value
* [core] Coverity 1395515 Logically dead code
* [core] Coverity 1364984 Result is not floating-point
* [core] Coverity 1395554, 1468440 Dereference before null check
* [core] Coverity 1024487 Dereference after null check
* [core] Coverity 1024872 Unchecked return value
* [core] Coverity 1025822 Unchecked return value
* [core] Coverity 1025823 Unchecked return value
* [core] Coverity 1087637, 1346467, 1087638 Unchecked return value
* [core] Coverity 1107607 Unchecked return value
* [core] Coverity 1210777 Unchecked return value
* [core] Coverity 1227670 Dereference before null check
* [core] Coverity 1024551 Logically dead code
* [core] Coverity 1024560 Logically dead code
* [core] Coverity 1024664 Operands don't affect result
* [core] Coverity 1364957 Dereference after null check
* [core] Coverity 1395572 Logically dead code
* [core] Coverity 1412459 Unchecked return value
* [core] Coverity 1412490 Unchecked return value
* [core] Coverity 1395515/2 Logically dead code
* [core] Coverity cleanup
2023-09-08 20:17:57 +03:00
Jakub Karolczyk
55f2dc4759
[core] Coverity fixes
...
* [core] Coverity CID 1024233 (Dereference before null check)
* [core] Coverity CID 1024239 (Dereference before null check)
* [core] Coverity CID 1024242 (Dereference before null check)
* [core] Coverity CID 1024243 (Dereference before null check)
* [core] Coverity CID 1024453 (Dereference before null check)
* [core] Coverity CID 1024554 (Logically dead code)
* [core] Coverity CID 1024868 (unchecked return value from library)
* [core] Coverity CID 1024869 (unchecked return value from library)
* [core] Coverity CID 1468281 (Dereference before null check)
* [core] Coverity CID 1024238 (Dereference before null check)
* [core] Coverity CID 1468621 (Copy into fixed size buffer)
* [core] Coverity CID 1024871 (Unchecked return value)
2023-07-21 13:49:40 +03:00
Jakub Karolczyk
49c1c35982
[core] Coverity fixes
...
* [core] Coverity CID 1468218 (Resource leak)
* [core] Coverity CID 1468214 (Resource leak)
* [core] Coverity CID 1294472 (Resource leak)
* [core] Coverity CID 1294470 (Resource leak)
* [core] Coverity CID 1500361 (Resource leak)
* [core] Coverity CID 1500308 (Resource leak)
* [core] Coverity CID 1500278 (Resource leak)
---------
Co-authored-by: Andrey Volk <andywolk@gmail.com>
2023-04-01 00:07:59 +03:00
Andrey Volk
dd3075a203
[Core] Fix Windows build after apr-util removal
2022-08-29 20:17:12 +03:00
Andrey Volk
f3c7c4d445
[Core] scan-build: Fix false-positive bad free by switch_must_realloc() in switch_xml_proc_inst()
2022-08-10 00:15:45 +03:00
Andrey Volk
56b6e954cf
[Core] Fix dead nested assignments
2022-08-09 23:29:31 +03:00
Anthony Minessale
39b3caacb5
[core, mod_commands, mod_verto] small tweaks to cache stuff to allow clear from verto and allow no domain to imply the default domain
2021-10-23 22:01:02 +03:00
Chris Rienzo
8e17dca00d
[core] Save position of XML opening tag '>' and XML closing tag '<' in switch_xml_parse_str().
2021-10-23 22:00:55 +03:00
Andrey Volk
dca7940fb9
[Core] scan-build: Use of zero allocated in switch_xml_str2utf8()
2021-10-19 20:30:18 +03:00
Andrey Volk
c35a3bb4db
[Core] scan-build: fix false-positive memory leak in switch_xml_set_attr_d and switch_xml_set_attr_d_buf
2021-10-19 20:30:18 +03:00
Andrey Volk
781180ff48
[Core] scan-build: memory leak in switch_xml_user_cache()
2021-10-19 20:30:17 +03:00
Andrey Volk
e30c62f8ec
[Core] scan-build: Argument with 'nonnull' attribute passed null in switch_xml_internal_dtd()
2021-10-19 20:30:17 +03:00
Andrey Volk
e42ebbb33f
[Core] scan-build: Fix false-positive use-after-free in switch_xml_free_attr(). Add unit test.
2021-10-19 20:15:58 +03:00
Andrey Volk
95fb8c7773
[Core] Fix crash on removing xml attributes. Add unit test.
2021-10-19 20:15:57 +03:00
Andrey Volk
b59c28bdbd
[Core] scan-build: fix false-positive use-after-free in switch_xml_internal_dtd()
2021-10-19 20:10:35 +03:00
Andrey Volk
53cd06900c
[Core] Fix leak in switch_xml_set_attr().
2020-04-28 21:43:58 +04:00
Dragos Oancea
c6f5869474
[core] scan-build: Function call argument is an uninitialized value - switch_xml_set_attr()
2020-02-21 07:00:18 +00:00
Dragos Oancea
fde2f685e7
[core] scan-build: Value stored to 'lcount' is never read - switch_xml_toxml_r()
2020-02-13 12:12:01 +00:00
Seven Du
79079942de
[core] add option to toggle ampersand entities on/off when serialize xml string
2019-12-31 03:03:41 +04:00
Seven Du
917d850b04
[core] remember if a tag is parsed from CDATA
2019-12-31 03:03:04 +04:00
Andrey Volk
718d2341f7
FS-11952: [Core] Fix memory leaks.
2019-07-24 20:26:32 +04:00
Chris Rienzo
c776680c56
FS-11785 [core, mod_commands] update XML API to fix scan-build false positive memory leaks
2019-07-17 20:21:57 +04:00
Andrey Volk
0ac27178f8
FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for switch_xml.c
2019-07-15 23:46:03 +04:00
Mike Jerris
1c63aceba5
FS-11184: [core] fix build errors
2019-02-12 11:52:12 -05:00
Mike Jerris
720f3ee182
Merge pull request #1527 in FS/freeswitch from ~LAZEDO/freeswitch:feature/FS-11184 to master
...
* commit '9d9b44e5f6a50f7ee890422921cba1cb5598da11':
FS-11184 [core] retry xml_locate_language for primary language
2019-02-12 15:51:34 +00:00
lazedo
9d9b44e5f6
FS-11184 [core] retry xml_locate_language for primary language
2019-02-12 15:50:20 +00:00
Andrey Volk
0629f95cff
FS-11568: [core] Add stun-set command to X-PRE-PROCESS.
2019-01-09 17:19:22 +04:00
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. "�x1;" 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