Files
asterisk/main
Richard Mudgett e31cb6b248 strings.h: Fix issues with escape string functions.
Fixes for issues with the ASTERISK-24934 patch.

* Fixed ast_escape_alloc() and ast_escape_c_alloc() if the s parameter is
an empty string.  If it were an empty string the functions returned NULL
as if there were a memory allocation failure.  This failure caused the AMI
VarSet event to not get posted if the new value was an empty string.

* Fixed dest buffer overwrite potential in ast_escape() and
ast_escape_c().  If the dest buffer size is smaller than the space needed
by the escaped s parameter string then the dest buffer would be written
beyond the end by the nul string terminator.  The num parameter was really
the dest buffer size parameter so I renamed it to size.

* Made nul terminate the dest buffer if the source string parameter s was
an empty string in ast_escape() and ast_escape_c().

* Updated ast_escape() and ast_escape_c() doxygen function description
comments to reflect reality.

* Added some more unit test cases to /main/strings/escape to cover the
empty source string issues.

ASTERISK-25255 #close
Reported by: Richard Mudgett

Change-Id: Id77fc704600ebcce81615c1200296f74de254104
2015-07-15 19:56:32 -05:00
..
2015-04-12 13:58:49 -05:00
2015-06-02 16:27:51 -05:00
2015-01-30 16:47:50 +00:00
2015-03-25 18:37:04 +00:00
2014-10-10 13:01:41 +00:00
2015-06-05 02:16:24 -05:00
2013-09-10 18:05:47 +00:00
2014-05-09 22:49:26 +00:00
2015-06-02 16:27:51 -05:00
2015-06-03 14:03:18 -05:00
2015-01-26 14:49:32 +00:00
2015-06-03 14:03:18 -05:00