Fixed problems in URI parsing including memory corruption.
Fixed issues in CAParseURI that included
* Use of uint32_t instead of size_t.
- Passing by address resulted in corruption on 64-bit builds and all
others where the datatypes are different. This includes various
embedded devices that have a size_t smaller than uint32_t.
* Miscalculation of offset would freeze parsing once a few path components
or parameters were processed.
- While walking parsed results list the buffer-check addition would fail
and all subsequent path components or parameters (depending on each
independently) would repeat the contents of a prior item. Thus the end
of path components and/or parameter parts of the list would be filled
with repeats of a single value instead of the correct latter values.
* Replaced duplicated code blocks with a single helper function.
* Added unit tests for issue. However the test cases won't be runnable
until after the build machine issue with connectivity/test is addressed.
Change-Id: Ife3f327ae3bbda518d663bb0d6c5b4c0d8f98e9a
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/470
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>
Reviewed-by: Joseph Morrow <joseph.l.morrow@intel.com>
Reviewed-by: Erich Keane <erich.keane@intel.com>