Imported Upstream version 0.11.7 upstream/0.11.7
authorDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 24 Dec 2021 02:25:00 +0000 (11:25 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 24 Dec 2021 02:25:00 +0000 (11:25 +0900)
13 files changed:
CMakeLists.txt
ChangeLog
INSTALL
RELEASE
THANKS
src/CMakeLists.txt
src/wbxml_encoder.c
src/wbxml_tree.h
test/api/test_wbxml_base64.c
test/api/test_wbxml_buffers.c
test/tools/launchTests.sh
tools/wbxml2xml_tool.c
tools/xml2wbxml_tool.c

index bbdad872792009c538b62b820159ed7f7ec749ea..84bf55d7a7744b2ce7a188701e0c321a39f1dfb9 100644 (file)
@@ -2,7 +2,7 @@ PROJECT( libwbxml C )
 
 SET( LIBWBXML_VERSION_MAJOR "0" )
 SET( LIBWBXML_VERSION_MINOR "11" )
-SET( LIBWBXML_VERSION_PATCH "6" )
+SET( LIBWBXML_VERSION_PATCH "7" )
 IF( LIBWBXML_VERSION_BETA )
     IF( LIBWBXML_VERSION_BETA VERSION_GREATER 90 )
         MATH( EXPR LIBWBXML_VERSION_MINOR "${LIBWBXML_VERSION_MINOR} - 1" )
@@ -23,7 +23,7 @@ SET( LIBWBXML_LIBVERSION_CURRENT 1 )
 # UPDATE: last release.
 # UPDATE: Set REVISION to 0 if any interface have been added, removed or
 # UPDATE: changed since the last update.
-SET( LIBWBXML_LIBVERSION_REVISION 6 )
+SET( LIBWBXML_LIBVERSION_REVISION 7 )
 
 # The difference between the newest and the oldest interfaces.
 # UPDATE: If any interface have been added since the last public
@@ -37,6 +37,20 @@ MATH( EXPR LIBWBXML_LIBVERSION_SOVERSION "${LIBWBXML_LIBVERSION_CURRENT} - ${LIB
 
 SET( LIBWBXML_LIBVERSION_VERSION "${LIBWBXML_LIBVERSION_SOVERSION}.${LIBWBXML_LIBVERSION_AGE}.${LIBWBXML_LIBVERSION_REVISION}" )
 
+# this hack protects the SO versioning of the library
+# it makes the exposing of internal header files possible and safe
+# usual library version: 2.6.1
+# special library version: 20601.0.0
+IF( WBXML_INSTALL_FULL_HEADERS )
+
+    # calculate big major version
+    MATH( EXPR LIBWBXML_LIBVERSION_SOVERSION "10000 * ${LIBWBXML_LIBVERSION_SOVERSION} + 100 * ${LIBWBXML_LIBVERSION_AGE} + ${LIBWBXML_LIBVERSION_REVISION}" )
+
+    # build a x.0.0 version
+    SET( LIBWBXML_LIBVERSION_VERSION "${LIBWBXML_LIBVERSION_SOVERSION}.0.0" )
+
+ENDIF( WBXML_INSTALL_FULL_HEADERS )
+
 CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
 
 # TODO: Move to external file/macro
@@ -151,6 +165,7 @@ OPTION( WBXML_SUPPORT_SYNCML "enable SYNCML support" ON )
 OPTION( WBXML_SUPPORT_WV "enable WV support" ON )
 OPTION( WBXML_SUPPORT_AIRSYNC "enable AIRSYNC support" ON )
 OPTION( WBXML_SUPPORT_CONML "enable Nokia ConML support" ON )
+OPTION( WBXML_INSTALL_FULL_HEADERS "install internal headers" OFF )
 
 SET( PACKAGE "libwbxml" )
 SET( PACKAGE_BUGREPORT " " )
@@ -233,6 +248,7 @@ SHOW_STATUS( WBXML_SUPPORT_CONML "enable Nokia ConML support\t" )
 SHOW_STATUS( BUILD_DOCUMENTATION "build dynamic documentation\t" )
 SHOW_STATUS( WBXML_SUPPORT_ICONV "enable iconv support\t\t" )
 SHOW_STATUS( ENABLE_INSTALL_DOC "install documentation\t" )
+SHOW_STATUS( WBXML_INSTALL_FULL_HEADERS "install internal headers\t" )
 
 # fatal error detection
 IF ( FATAL_ERROR_EXPAT )
index 396b04b62e42cfaf4162bced704b7ec135ef5659..dfb0ace1ce2f8a058b22a9489cb596b645f9127a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2020-04-15  Michael Bell <michael.bell@web.de>
+  * Released 0.11.7
+  * Added WBXML_INSTALL_FULL_HEADERS cmake flag to expose internal API
+    headers; changes version for compatibility (e.g. 2.6.1 -> 20601.0.0)
+    (pull request #67 from David Llewellyn-Jones)
+  * Link to libexpat correctly (private). Therefore the tools wbxml2xml
+    and xml2wbxml do no longer link directly to libexpat.
+    (pull request #65 from Peter Keresztes Schmidt)
+  * During build use headers which come with source code and not the
+    installed headers. (pull request #66 from David Llewellyn-Jones)
+  * Fixed several memory leaks and leak-sanitizer issues.
+    (pull requests #61, #62, #63 and #64 from Gaurav Gupta)
+
 2017-08-15  Michael Bell <michael.bell@web.de>
   * Released 0.11.6
   * Fixed/changed the encoding of element Content in CodePage
diff --git a/INSTALL b/INSTALL
index dc84e60c9f4957df14ba25b043ca1066d6acc5dc..b2a1e21a2f2132a2ba2b863cccc379714564fdc3 100644 (file)
--- a/INSTALL
+++ b/INSTALL
     WBXML_SUPPORT_OTA_SETTINGS : Support of Ericsson / Nokia OTA Settings v7.0
     WBXML_SUPPORT_SYNCML : Support of SyncML 1.0 / SyncML 1.1 / SyncML 1.2
     WBXML_SUPPORT_WV : Support of Wireless-Village CSP 1.1 / CSP 1.2
+    WBXML_SUPPORT_AIRSYNC : Support of AIRSYNC 2.5
+    WBXML_SUPPORT_CONML : Support of Nokia ConML
     
     HAVE_EXPAT : Enable XML Parsing feature (needs Expat)
+    WBXML_INSTALL_FULL_HEADERS : Install unstable internal API headers
     
     BUILD_SHARED_LIBS : Build wbxml as shared library
     BUILD_STATIC_LIBS : Build wbxml as static library
diff --git a/RELEASE b/RELEASE
index 2be69a29fa16f2b664080ba911f646ffbbace1ec..c6aad7e6d03fe074970da0c488c1add5465e7b5b 100644 (file)
--- a/RELEASE
+++ b/RELEASE
@@ -31,7 +31,15 @@ To make a release of libwbxml, do the following:
    "make"
    "make test"
 
- - Commit and push the increased version changes (and build fixes)
+ - Check ChangeLog to be complete and add the new release name.
+
+ - Final steps with git:
+   git pull origin
+   git pull upstream master
+   git status
+   git commit -a
+   git tag libwbxml-$MAJOR.$MINOR.$PATCH
+   git push origin libwbxml-$MAJOR.$MINOR.$PATCH
 
  - if someone else made changes and the push fails,
    you have to "git pull" and run the tests again
@@ -39,9 +47,8 @@ To make a release of libwbxml, do the following:
  - please run "git status" before you continue to be 100 percent sure
    that there is no forgotten commit and no unrevisioned file.
 
- - Check ChangeLog to be complete and add the new release name.
-
  - Once the commit succeeds, you have to create a new release on GitHub.
+   Please create a pull request from your fork.
    Please use the web GUI of Github and write some useful release notes. 
 
  - create tarballs for an out-of-source-build with
diff --git a/THANKS b/THANKS
index 91c087afc1675bd5a9b6710de611043712fcf773..2ec9664c7b2c8e20d89a12967486e9bdc1addc43 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -8,22 +8,25 @@ Michael Bell <michael.bell@web.de>
 
 The following people helped to develop and maintain this library:
 
-Amnon Aaronsohn     (ActiveSync)
-Pau Aliagas         <pau@smsarena.com>
-Michael Banck       (Debian package maintainer, testing)
-Michael Bell        <michael.bell@web.de>
-Gaurav Gupta        <g.gupta@samsung.com>
-Gil Hartmann        (Active Sync v16.0)
-Conrad Irwin        (performance fixes)
-Aymerick Jehanne    <aymerick@jehanne.org>
-Ossi Jormakka       (Ixonos Plc., ActiveSync)
-Anton D. Kachalov   (Nokia ConML support)
-Benedykt Kroplewski <benedykt@age.pl>
-Jeremy Lainé        (helped with cmake on Win32)
-Mark Ostrer         (Websense)
-Petr Písař          (RedHat/Fedora package maintainer)
-Renu Tyagi          (fixed some memory leaks)
-Boaz Yaniv          (MS Visual Studio fixes)
+Amnon Aaronsohn         (ActiveSync)
+Pau Aliagas             <pau@smsarena.com>
+Michael Banck           (Debian package maintainer, testing)
+Michael Bell            <michael.bell@web.de>
+Gaurav Gupta            <g.gupta@samsung.com>
+Gil Hartmann            (Active Sync v16.0)
+Conrad Irwin            (performance fixes)
+Aymerick Jehanne        <aymerick@jehanne.org>
+Ossi Jormakka           (Ixonos Plc., ActiveSync)
+Anton D. Kachalov       (Nokia ConML support)
+Peter Keresztes Schmidt (fixed libexpat linking)
+Benedykt Kroplewski      <benedykt@age.pl>
+Jeremy Lainé             (helped with cmake on Win32)
+Mark Ostrer              (Websense)
+Petr Písař               (RedHat/Fedora package maintainer)
+Renu Tyagi               (fixed some memory leaks)
+Boaz Yaniv               (MS Visual Studio fixes)
+Slava Monich             <slava@monich.com>
+David Llewellyn-Jones    <david.llewellyn-jones@jolla.com>
 
 If you think your name is missing here
 then please feel free to create a ticket.
index 33a8d7235e2bd556669f3d75464e94dd7297c9bd..33bd54b53fd9bee4b01401a5356118ced19f822e 100644 (file)
@@ -30,7 +30,7 @@ IF(BUILD_SHARED_LIBS)
 
        SET_TARGET_PROPERTIES( wbxml2 PROPERTIES SOVERSION ${LIBWBXML_LIBVERSION_SOVERSION} )
        SET_TARGET_PROPERTIES( wbxml2 PROPERTIES VERSION ${LIBWBXML_LIBVERSION_VERSION} )
-       TARGET_LINK_LIBRARIES( wbxml2 ${EXPAT_LIBRARIES} )
+       TARGET_LINK_LIBRARIES( wbxml2 PRIVATE ${EXPAT_LIBRARIES} )
 
        INSTALL( TARGETS wbxml2
           RUNTIME DESTINATION ${LIBWBXML_BIN_DIR}
@@ -44,7 +44,7 @@ IF(BUILD_STATIC_LIBS)
 
        SET_TARGET_PROPERTIES( wbxml2_static PROPERTIES SOVERSION ${LIBWBXML_LIBVERSION_SOVERSION} )
        SET_TARGET_PROPERTIES( wbxml2_static PROPERTIES VERSION ${LIBWBXML_LIBVERSION_VERSION} )
-       TARGET_LINK_LIBRARIES( wbxml2_static ${EXPAT_LIBRARIES} )
+       TARGET_LINK_LIBRARIES( wbxml2_static PRIVATE ${EXPAT_LIBRARIES} )
        SET_TARGET_PROPERTIES( wbxml2_static PROPERTIES OUTPUT_NAME wbxml2 )
 
        INSTALL( TARGETS wbxml2_static
@@ -64,3 +64,22 @@ INSTALL( FILES
        DESTINATION ${LIBWBXML_INCLUDE_DIR}/wbxml
 )
 
+IF(WBXML_INSTALL_FULL_HEADERS)
+    INSTALL( FILES
+        wbxml_base64.h
+        wbxml_buffers.h
+        wbxml_charset.h
+        wbxml_elt.h
+        wbxml_encoder.h
+        wbxml_handlers.h
+        wbxml_lists.h
+        wbxml_log.h
+        wbxml_mem.h
+        wbxml_parser.h
+        wbxml_tables.h
+        wbxml_tree.h
+        wbxml_tree_clb_wbxml.h
+        wbxml_tree_clb_xml.h
+        DESTINATION ${LIBWBXML_INCLUDE_DIR}/wbxml
+    )
+ENDIF()
index cd2d6bc2cffa3826c571a5f359627eeabb86eb5a..c73780f07e694a0d64e13844ff8514262fec65bc 100644 (file)
@@ -3177,7 +3177,6 @@ static WBXMLError wbxml_encode_wv_datetime_inline(WBXMLEncoder *encoder, WB_UTIN
  */
 static WBXMLError wbxml_encode_wv_datetime_opaque(WBXMLEncoder *encoder, WB_UTINY *buffer)
 {
-    WBXMLError error;
     WBXMLBuffer *tmp = NULL;
     WB_ULONG i = 0, len = 0;
     WB_UTINY ch = 0;
@@ -3192,7 +3191,7 @@ static WBXMLError wbxml_encode_wv_datetime_opaque(WBXMLEncoder *encoder, WB_UTIN
 
     /* Create temp Buffer */
     if ((tmp = wbxml_buffer_create_from_cstr(buffer)) == NULL) {
-        error = WBXML_ERROR_NOT_ENOUGH_MEMORY;
+        ret = WBXML_ERROR_NOT_ENOUGH_MEMORY;
         goto error;
     }
 
@@ -3211,26 +3210,26 @@ static WBXMLError wbxml_encode_wv_datetime_opaque(WBXMLEncoder *encoder, WB_UTIN
     }
     if ((len != 15) && (len != 16)) {
         WBXML_ERROR((WBXML_CONV, "The length of a WV datetime must be 15 or 16."));
-        error = WBXML_ERROR_WV_DATETIME_FORMAT;
+        ret = WBXML_ERROR_WV_DATETIME_FORMAT;
         goto error;
     }
 
     /* Check position of 'T' */
     if (*(buffer+8) != 'T') {
         WBXML_ERROR((WBXML_CONV, "The 9th character of a WV datetime must be 'T'."));
-        error = WBXML_ERROR_WV_DATETIME_FORMAT;
+        ret = WBXML_ERROR_WV_DATETIME_FORMAT;
         goto error;
     }
 
     /* Check position of time zone */
     if (len == 16) {
         if (!wbxml_buffer_get_char(tmp, 15, &ch)) {
-            error = WBXML_ERROR_INTERNAL;
+            ret = WBXML_ERROR_INTERNAL;
             goto error;
         }
         if (ch < 'A' || ch == 'J' || ch > 'Z') {
             WBXML_ERROR((WBXML_CONV, "If the length of a WV datetime is 16 then the last character must be the time zone."));
-            error = WBXML_ERROR_WV_DATETIME_FORMAT;
+            ret = WBXML_ERROR_WV_DATETIME_FORMAT;
             goto error;
         }
 
@@ -3251,12 +3250,12 @@ static WBXMLError wbxml_encode_wv_datetime_opaque(WBXMLEncoder *encoder, WB_UTIN
     while (i < wbxml_buffer_len(tmp)) {
         /* Get char */
         if (!wbxml_buffer_get_char(tmp, i, &ch)) {
-            error = WBXML_ERROR_INTERNAL;
+            ret = WBXML_ERROR_INTERNAL;
             goto error;
         }
 
         if (!WBXML_ISDIGIT(ch)) {
-            error = WBXML_ERROR_WV_DATETIME_FORMAT;
+            ret = WBXML_ERROR_WV_DATETIME_FORMAT;
             goto error;
         }
         else
@@ -3268,7 +3267,7 @@ static WBXMLError wbxml_encode_wv_datetime_opaque(WBXMLEncoder *encoder, WB_UTIN
     /* Set Year */
     component = wbxml_buffer_duplicate(tmp);
     if (!component) {
-        error = WBXML_ERROR_NOT_ENOUGH_MEMORY;
+        ret = WBXML_ERROR_NOT_ENOUGH_MEMORY;
         goto error;
     }
     wbxml_buffer_delete(component, 4, 10);
@@ -3280,7 +3279,7 @@ static WBXMLError wbxml_encode_wv_datetime_opaque(WBXMLEncoder *encoder, WB_UTIN
     /* Set Month */
     component = wbxml_buffer_duplicate(tmp);
     if (!component) {
-        error = WBXML_ERROR_NOT_ENOUGH_MEMORY;
+        ret = WBXML_ERROR_NOT_ENOUGH_MEMORY;
         goto error;
     }
     wbxml_buffer_delete(component, 0, 4);
@@ -3294,7 +3293,7 @@ static WBXMLError wbxml_encode_wv_datetime_opaque(WBXMLEncoder *encoder, WB_UTIN
     /* Set Day */
     component = wbxml_buffer_duplicate(tmp);
     if (!component) {
-        error = WBXML_ERROR_NOT_ENOUGH_MEMORY;
+        ret = WBXML_ERROR_NOT_ENOUGH_MEMORY;
         goto error;
     }
     wbxml_buffer_delete(component, 0, 6);
@@ -3307,7 +3306,7 @@ static WBXMLError wbxml_encode_wv_datetime_opaque(WBXMLEncoder *encoder, WB_UTIN
     /* Set Hour */
     component = wbxml_buffer_duplicate(tmp);
     if (!component) {
-        error = WBXML_ERROR_NOT_ENOUGH_MEMORY;
+        ret = WBXML_ERROR_NOT_ENOUGH_MEMORY;
         goto error;
     }
     wbxml_buffer_delete(component, 0, 8);
@@ -3321,7 +3320,7 @@ static WBXMLError wbxml_encode_wv_datetime_opaque(WBXMLEncoder *encoder, WB_UTIN
     /* Set Minute */
     component = wbxml_buffer_duplicate(tmp);
     if (!component) {
-        error = WBXML_ERROR_NOT_ENOUGH_MEMORY;
+        ret = WBXML_ERROR_NOT_ENOUGH_MEMORY;
         goto error;
     }
     wbxml_buffer_delete(component, 0, 10);
@@ -3335,7 +3334,7 @@ static WBXMLError wbxml_encode_wv_datetime_opaque(WBXMLEncoder *encoder, WB_UTIN
     /* Set Second */
     component = wbxml_buffer_duplicate(tmp);
     if (!component) {
-        error = WBXML_ERROR_NOT_ENOUGH_MEMORY;
+        ret = WBXML_ERROR_NOT_ENOUGH_MEMORY;
         goto error;
     }
     wbxml_buffer_delete(component, 0, 12);
@@ -3348,12 +3347,11 @@ static WBXMLError wbxml_encode_wv_datetime_opaque(WBXMLEncoder *encoder, WB_UTIN
 
     /* Encode it to Opaque */
     ret = wbxml_encode_opaque_data(encoder, octets, 6);
-
-    return ret;
+       
 error:
     if (tmp)
         wbxml_buffer_destroy(tmp);
-    return error;
+    return ret;
 }
 
 
index 3c5a6adb8953e0b6aa7f2634a8d46086561d83a6..8f7dfc964d39d47837b5ddcc8151f6c71bed8d93 100644 (file)
@@ -43,7 +43,7 @@
 extern "C" {
 #endif /* __cplusplus */
 
-#include <wbxml_config.h>
+#include "wbxml_config.h"
 
 /** @addtogroup wbxml_tree
  *  @{ 
index c22b59cb89679bfe2bcfcdf4dda4736889e39cc2..61ce5af4b7a0e91bd2970651fbba95b0c269a468 100644 (file)
@@ -34,7 +34,9 @@ START_TEST (test_decode)
     ck_assert(wbxml_base64_decode(NULL, 0, &result) <= 0);
     ck_assert(wbxml_base64_decode(NULL, 1, &result) <= 0);
     ck_assert(wbxml_base64_decode((const WB_UTINY*) "", 0, &result) <= 0);
+    wbxml_free(result);
     ck_assert(wbxml_base64_decode((const WB_UTINY*) "test", 0, &result) <= 0);
+    wbxml_free(result);
 
     /* decode a string */
 
index 01ce636b10603cc844a6e69d193a6ab9680a46ed..a541c0b5f1b63d11e389c91726781eebf82fb1fa 100644 (file)
@@ -78,6 +78,7 @@ START_TEST (test_init_and_destroy_static)
 
     ck_assert( ! wbxml_buffer_remove_trailing_zeros(buf));
 
+    wbxml_buffer_destroy(buf2);
     wbxml_buffer_destroy(buf);
 }
 END_TEST
@@ -237,6 +238,7 @@ START_TEST (test_insert)
     ck_assert(wbxml_buffer_insert(buf, buf2, 3));
     ck_assert(wbxml_buffer_len(buf) == 12);
     ck_assert(wbxml_buffer_compare_cstr(buf, "123XYZtes7t9") == 0);
+    wbxml_buffer_destroy(buf2);
 
     wbxml_buffer_destroy(buf);
 }
@@ -332,6 +334,7 @@ START_TEST (test_compare)
     ck_assert(wbxml_buffer_compare(buf, buf2) != 0);
     ck_assert(wbxml_buffer_compare_cstr(buf, "test") != 0);
 
+    wbxml_buffer_destroy(buf2);
     wbxml_buffer_destroy(buf);
 }
 END_TEST
index 107c9e7360371d3fcaaea1cc73db7e600a65f520..5757dd4314056ceea8b517c3a6eb82c54cf22baf 100755 (executable)
@@ -45,7 +45,7 @@ fi
 # Debian does this by default
 if [ "${CMAKE_SKIP_RPATH}" ]
 then
-       LD_LIBRARY_PATH="${CMAKE_CURRENT_BINARY_DIR}/../../src"
+       LD_LIBRARY_PATH="${CMAKE_CURRENT_BINARY_DIR}/../../src:$LD_LIBRARY_PATH"
        export LD_LIBRARY_PATH
 fi
 
index 415d46d1685d1fe704106933d83e7eee54b6b71d..3fde0e1786a0156dd7a23ccc0f76888d2e66fe21 100644 (file)
@@ -367,14 +367,14 @@ WB_LONG main(WB_LONG argc, WB_TINY **argv)
         case '?':
         default:
             help();
-            return 0;
+            goto clean_up;
         }
     }
 
     if (optind >= argc) {
         fprintf(stderr, "Missing arguments\n");
         help();
-        return 0;
+        goto clean_up;
     }
 
 #ifdef WBXML_USE_LEAKTRACKER
index 4c0b646da0ef25bbfe48c91adbcffca0be8d3d71..6186bea5b39a7b7ac6d4cd97b07c294a794f91ba 100644 (file)
@@ -146,14 +146,14 @@ WB_LONG main(WB_LONG argc, WB_TINY **argv)
         case '?':
         default:
             help();
-            return 0;
+            goto clean_up;
         }
     }
 
     if (optind >= argc) {
         fprintf(stderr, "Missing arguments\n");
         help();
-        return 0;
+        goto clean_up;
     }
 
 #ifdef WBXML_USE_LEAKTRACKER