summaryrefslogtreecommitdiff
path: root/net-libs/nDPI
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-05-30 11:44:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-05-30 11:44:06 +0100
commitf516638b7fe9592837389826a6152a7e1b251c54 (patch)
tree8bfecb640b7b6403d7a3d662d923eed630033da7 /net-libs/nDPI
parent1a61119f9f7b057830e2ce0563f913ec86f282ad (diff)
gentoo resync : 30.05.2020
Diffstat (limited to 'net-libs/nDPI')
-rw-r--r--net-libs/nDPI/Manifest7
-rw-r--r--net-libs/nDPI/files/nDPI-3.2-0000-Check-NULL-strings-in-ndpi_serialize_string_string.patch23
-rw-r--r--net-libs/nDPI/files/nDPI-3.2-0001-Added-fix-for-serialization-loop.patch28
-rw-r--r--net-libs/nDPI/files/nDPI-3.2-0002-Refresh-of-ndpi_netbios_name_interpret.patch74
-rw-r--r--net-libs/nDPI/files/nDPI-3.2-0003-Fixed-invalid-allocation.patch22
-rw-r--r--net-libs/nDPI/files/nDPI-3.2-0004-Fix-for-serialization-of-strings-where-the-first-element-is-a-zero-le.patch208
-rw-r--r--net-libs/nDPI/nDPI-3.2-r1.ebuild (renamed from net-libs/nDPI/nDPI-3.2.ebuild)7
7 files changed, 368 insertions, 1 deletions
diff --git a/net-libs/nDPI/Manifest b/net-libs/nDPI/Manifest
index 317b96dc2ad0..483adb46fdd5 100644
--- a/net-libs/nDPI/Manifest
+++ b/net-libs/nDPI/Manifest
@@ -1,6 +1,11 @@
AUX nDPI-2.2-libcache-include.patch 819 BLAKE2B 5a0698bc19917ebfd737e886937d023e83452bfdd812010e2b2622461ca8eb6758533ecf5c1b01495eab21de72fd7f0608dd826d864336446f893d083b68ed55 SHA512 854b65c5dbdb19bd73040ed12740c945e0f31e50c51a0ebd32c646177043e28eee79e572747fe23580f7c2cca7cf59a22655f084e111bec3e146a4d4b6d941cc
AUX nDPI-2.8-fix-pkgconfigdir.patch 248 BLAKE2B c5dcef9651cfcaf1a422903d1231584b7a29c07caba193ab016c380f3cf95887c29ba709ccebfd7649d1f6469bb7116b08f1e1fc384c7e3f00c2e2ae621a3934 SHA512 b461d43ba5673310b4dc0bc37ae772dc1940c5817a6d3817bdab6e6e4a4c86d9797163f458f07417aa3b707253bcc50428b021b6e042f52480597789b92ceffb
AUX nDPI-2.8-relative-sym.patch 618 BLAKE2B 09a859edccfea2816bdb62e68fff04f11c414a39f6237f1a4606fd88761bb38462fde9ac042352bcccb49b5da713d6f18388e7ec8d4d9a9a351caa4966ac46a8 SHA512 bede4effffd351a2bfe87251ea512c0688f97b89a344f2a91ee0860a74e67535fb611ec11c162f91dd6d612e4a268ac2f551083e790e992f38f1e3173cbc4fc8
+AUX nDPI-3.2-0000-Check-NULL-strings-in-ndpi_serialize_string_string.patch 1041 BLAKE2B a513bcff2b9efb52a61e843c8f5d28558786db6dd3f38fc53d1c7461199ef5bfd81a4d30eb5c1279ef36979f585135c9511e4f59f93b015411cc3084fe1a7a75 SHA512 42f5efd626946ff7825be47ba9b2729216342213a1e886eb969f27a9c3757db1ac788d03592240156386c201de7457e1366df37a838da582b4f2afbc07f4f7a5
+AUX nDPI-3.2-0001-Added-fix-for-serialization-loop.patch 916 BLAKE2B 85c6f19146c2eb5b50fd524f6584566d9abe81e55b2c5d108f0022577201170ac48ee9f3240935416988cb37df90efeb12e38bc46b9428bd946da7c463d748bb SHA512 430881fcec23252aca4de4786b16abbc6845d879872560b268dcd6c5dc36b8d4f6ae6888103efcc7d4e4dd91f00c3e3e10dcf52ae5811b97e3877605ede41968
+AUX nDPI-3.2-0002-Refresh-of-ndpi_netbios_name_interpret.patch 2643 BLAKE2B be3d1a9bd632d4b1837d22248af94179debd48e4c99715553839f1f630cd0aec2ce345953d8f8fa1d01c682b6a466f565e850343541bf3a1a92d49a55d912d5b SHA512 41d849d2a1e204c82779896f5561cdc20ed1a4aa62391255bf7ef862589e1260ddd77bb44c6a9462cb3cc80d9de0aca731c8f78e3c06ca69dbead66a09b26018
+AUX nDPI-3.2-0003-Fixed-invalid-allocation.patch 794 BLAKE2B 3f8814e0c836dd0d2f05f5516154c43624a9b9cbf4a24f63a47334e808cc9e28fdc3c51d31f743dfb62fc8ca13187ed21e66122d50a03fd4d6bdaff85f49069d SHA512 2b20d6b92497dd23f72d2c486f32b749dc2e2b86547443629b57dc00aa163155eebef2d5ea123386f257a582e437f886787421ce2232be0f7d35853b6997cd4d
+AUX nDPI-3.2-0004-Fix-for-serialization-of-strings-where-the-first-element-is-a-zero-le.patch 6861 BLAKE2B a5e3c17b895167da57ec472444bb5933eca44120c4281a455e494c1ab62806619f3eb860ba1deaded8049a03c4953d2c4c8951187c1aabddfc3ae7d5e8bebc95 SHA512 173ff8a9568cf2e56e0ea1a271de0090f02fd2a0bc17be6e02b1bfed0327ddc78014fbe6f2fc5850eb5a2141f133cdc70f2ce614ff5f6e820cb577cfdb8d5513
DIST nDPI-2.0.tar.gz 19280901 BLAKE2B d08bd807b556394b708713061ef23025be296b3c847c90680170b2d39f23f05fac35a1ced091925383f57c0d0be6e5f0c7ad239168c76caa7b9a46847413e860 SHA512 c8dac1990ff49fc04ee321068d8fc722528c6be0543af2d0bda77936eff12713c36d5abd3fd2472121f2e322e99ba8e57facca813f7b012240c61e16c1a6cd44
DIST nDPI-2.2.tar.gz 19937173 BLAKE2B a00287d5901487f7e56d7aeab7dcb357c0eb6348be5621952d9f357058419b6378d41b42d0d6e9ea6e20680cfda96fa501f2ebaae5c83dd4e62f756d1089a160 SHA512 ee1e0a1cc87a3971408877bd5d3154f6bd5d4ddcd2437c8e03e5d8a5093da2b1cbfefad1e28e77145af4286eecbd341ef90f94aa5c7f36a98e3625e9948e96d6
DIST nDPI-2.8.tar.gz 19754226 BLAKE2B c112ae2d9fff872f116a23bbffe7bca39a5c876346b4e41ef503934301f39413517fce169a37a766ffae16b0cb1ee81d96573ffa1ee2519d295dfb32cc1f115e SHA512 aae757047810bbc32700ecf7ac2e5df4b93528021a50da4a0b83865a5248dfca8b1643c75aa7eeb6eac4f155638d45666db487318b2be9adb2f3412cb8ec8497
@@ -11,6 +16,6 @@ EBUILD nDPI-2.2.ebuild 1013 BLAKE2B 4e5423411ded7c631b27615da56f8b1cd55ad0f66847
EBUILD nDPI-2.8.ebuild 1073 BLAKE2B 62465dfb22f70d24ba4947d7005ffebe89b930336c7ba1dd651649840b39245cd470e72c16c5ca46393bc28120d52315a0685249e7a2aa7f04ded86798b69e62 SHA512 dcf8abb346221acf640f858165a5049522c20ce7919466e733f34839c943b487e9beba309e73f7ee1b7a89ffa3b95115e4c7eb51f48cb42e4c7b5430017ccbe9
EBUILD nDPI-3.0-r1.ebuild 966 BLAKE2B c0b61a5243af862d1373a734ba8f0ffe8f95c40bb0ffac40dc72b1bca0a704eece2893d4c8d876744ee298a05243b21490f89218d9c493f7cdcd4ae4c3da2527 SHA512 8f0e6004fea392c1573477976b83de81e2bb3467bbcf4ffa18817f79c5b1cca00a6c35fbeccc753e41edbf7a8d15d1dd74bd68bd2af9d4726265c60bf8a3ebbe
EBUILD nDPI-3.0-r2.ebuild 1176 BLAKE2B 57e01bdf62c55c2c69f1bd64599a1838eb050371ac0f18e5beca7d453840e1abee0aea3cce222ce044fb7f9a084e5030459164eac680af892b897fdc8f1c1d10 SHA512 c82c47552699b3feaff9e2007fa357c0eded3175b28fa5817d64c35283fed2e9ed7499a5ac0944664243a859fcee4e41db0d1382eb8c0cd52bafec3388702724
-EBUILD nDPI-3.2.ebuild 1340 BLAKE2B 4d4829ebbb8a0bc90e05a78969c5a96e924bea9602b4d885df3033c4838f4b768da28b299fca715b54dc735f29fceb547f72669252a2532e287e5e924f8fc873 SHA512 cfa71e603ad0cf9275ada9c9c477280e694195e511204fa0a04437e295ad178a45c4fee3d71fdc24585c00e848caa6ded5b759c1edbbac0c02bc99ac5eba4ed1
+EBUILD nDPI-3.2-r1.ebuild 1750 BLAKE2B efc6ab0d48a8d5db4237d1f8b59705c9e489cfc2fafd431339c9a2c7a90ae3e9a28c9ea17313f34ed1912f93be7c9d32ce2528ee40960fbf354e6fc807b3ab2b SHA512 cc1662b4a436d51e586ebc67b4c4c88440e85203586a2fddfcb6c9d6593969665a6890b4b6211e717b4bbf4cd80230834af0a1dd1a8f1c14e6df63799f0c507e
EBUILD nDPI-9999.ebuild 1293 BLAKE2B d69406384a02ff5fa67aabcf6d97183b362b4fcf7bfb06fa4ba95e53469007305e197459e9250b4be800a89506a3542df3abf07ab60aef3d9aab93bcca5daa0d SHA512 6def195805ee8aff6339bb0a38a098048a95391b6aeed6319946d550e79aac36251d23d4401854b043e7f46003490d15736b67b1c3af044ffcc11b939bc38ff3
MISC metadata.xml 292 BLAKE2B 387a2816be3615c7a1430ca3888546eecd1b5c679805b87cf7975cf7d4b59a224c8edea34ca354b8bf4d793457531f6388816cdf86641fcc3f6df89432848b46 SHA512 488fc61860f278d9f7be4a6cd246eb45bac7efafe57e777f1c46984a07f132a76dcca6170b4876edea4d720f4696549b85989ae012749a00d234a0137b98ec6f
diff --git a/net-libs/nDPI/files/nDPI-3.2-0000-Check-NULL-strings-in-ndpi_serialize_string_string.patch b/net-libs/nDPI/files/nDPI-3.2-0000-Check-NULL-strings-in-ndpi_serialize_string_string.patch
new file mode 100644
index 000000000000..db26330d699f
--- /dev/null
+++ b/net-libs/nDPI/files/nDPI-3.2-0000-Check-NULL-strings-in-ndpi_serialize_string_string.patch
@@ -0,0 +1,23 @@
+From 15bb7ae4339cc2a4a626a52fcf49abfb1d237d65 Mon Sep 17 00:00:00 2001
+From: Alfredo Cardigliano <alfredo.cardigliano@gmail.com>
+Date: Wed, 26 Feb 2020 09:55:24 +0100
+Subject: [PATCH] Check NULL strings in ndpi_serialize_string_string
+
+---
+ src/lib/ndpi_serializer.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/lib/ndpi_serializer.c b/src/lib/ndpi_serializer.c
+index 05b346bb..9a3cd0bd 100644
+--- a/src/lib/ndpi_serializer.c
++++ b/src/lib/ndpi_serializer.c
+@@ -1270,7 +1270,8 @@ int ndpi_serialize_string_binary(ndpi_serializer *_serializer,
+ /* Key is a string, value is a string (strlen is used to compute the len) */
+ int ndpi_serialize_string_string(ndpi_serializer *_serializer,
+ const char *key, const char *_value) {
+- return(ndpi_serialize_binary_binary(_serializer, key, strlen(key), _value, strlen(_value)));
++ const char *value = _value ? _value : "";
++ return(ndpi_serialize_binary_binary(_serializer, key, strlen(key), value, strlen(value)));
+ }
+
+ /* ********************************** */
diff --git a/net-libs/nDPI/files/nDPI-3.2-0001-Added-fix-for-serialization-loop.patch b/net-libs/nDPI/files/nDPI-3.2-0001-Added-fix-for-serialization-loop.patch
new file mode 100644
index 000000000000..c2fbf28383fa
--- /dev/null
+++ b/net-libs/nDPI/files/nDPI-3.2-0001-Added-fix-for-serialization-loop.patch
@@ -0,0 +1,28 @@
+From 7b2f89ef25eafdd76e8b540f1d8ba1fdec185ef9 Mon Sep 17 00:00:00 2001
+From: Luca Deri <deri@ntop.org>
+Date: Fri, 20 Mar 2020 18:05:52 +0100
+Subject: [PATCH] Added fix for serialization loop
+
+---
+ src/lib/ndpi_serializer.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/src/lib/ndpi_serializer.c b/src/lib/ndpi_serializer.c
+index 9a3cd0bd..80221005 100644
+--- a/src/lib/ndpi_serializer.c
++++ b/src/lib/ndpi_serializer.c
+@@ -1054,8 +1054,12 @@ int ndpi_serialize_string_uint32_format(ndpi_serializer *_serializer,
+ */
+
+ return(ndpi_serialize_string_uint32(_serializer, key, value));
+- } else
+- return(ndpi_serialize_string_uint32_format(_serializer, key, value, format));
++ } else {
++ char buf[16];
++
++ snprintf(buf, sizeof(buf), format, value);
++ return(ndpi_serialize_string_string(_serializer, key, buf));
++ }
+ }
+
+ /* ********************************** */
diff --git a/net-libs/nDPI/files/nDPI-3.2-0002-Refresh-of-ndpi_netbios_name_interpret.patch b/net-libs/nDPI/files/nDPI-3.2-0002-Refresh-of-ndpi_netbios_name_interpret.patch
new file mode 100644
index 000000000000..69aa892d2d11
--- /dev/null
+++ b/net-libs/nDPI/files/nDPI-3.2-0002-Refresh-of-ndpi_netbios_name_interpret.patch
@@ -0,0 +1,74 @@
+From e4512dbcb9e1db0500290b712257e501d1440d71 Mon Sep 17 00:00:00 2001
+From: Luca Deri <deri@ntop.org>
+Date: Tue, 24 Mar 2020 12:18:15 +0100
+Subject: [PATCH] Refresh of ndpi_netbios_name_interpret
+
+---
+ src/include/ndpi_main.h | 2 +-
+ src/lib/protocols/netbios.c | 15 +++++++--------
+ 2 files changed, 8 insertions(+), 9 deletions(-)
+
+diff --git a/src/include/ndpi_main.h b/src/include/ndpi_main.h
+index c909adc7..9335f215 100644
+--- a/src/include/ndpi_main.h
++++ b/src/include/ndpi_main.h
+@@ -132,7 +132,7 @@ extern "C" {
+ u_int16_t** tcp_master_proto,
+ u_int16_t** udp_master_proto);
+ #/* NDPI_PROTOCOL_NETBIOS */
+- int ndpi_netbios_name_interpret(char *in, char *out, u_int out_len);
++ int ndpi_netbios_name_interpret(char *in, size_t inlen, char *out, u_int out_len);
+
+ #ifdef NDPI_ENABLE_DEBUG_MESSAGES
+ void ndpi_debug_get_last_log_function_line(struct ndpi_detection_module_struct *ndpi_struct,
+diff --git a/src/lib/protocols/netbios.c b/src/lib/protocols/netbios.c
+index 19cffeb8..1c65b185 100644
+--- a/src/lib/protocols/netbios.c
++++ b/src/lib/protocols/netbios.c
+@@ -35,17 +35,17 @@ struct netbios_header {
+ };
+
+ /* The function below has been inherited by tcpdump */
+-int ndpi_netbios_name_interpret(char *in, char *out, u_int out_len) {
++int ndpi_netbios_name_interpret(char *in, size_t inlen, char *out, u_int out_len) {
+ int ret = 0, len;
+ char *b;
+-
++
+ len = (*in++)/2;
+ b = out;
+ *out = 0;
+
+- if(len > (out_len-1) || len < 1)
+- return(-1);
+-
++ if(len > (out_len-1) || len < 1 || 2*len > inlen)
++ return(-1);
++
+ while (len--) {
+ if(in[0] < 'A' || in[0] > 'P' || in[1] < 'A' || in[1] > 'P') {
+ *out = 0;
+@@ -53,7 +53,7 @@ int ndpi_netbios_name_interpret(char *in, char *out, u_int out_len) {
+ }
+
+ *out = ((in[0]-'A')<<4) + (in[1]-'A');
+-
++
+ in += 2;
+
+ if(isprint(*out))
+@@ -69,13 +69,12 @@ int ndpi_netbios_name_interpret(char *in, char *out, u_int out_len) {
+ return(ret);
+ }
+
+-
+ static void ndpi_int_netbios_add_connection(struct ndpi_detection_module_struct
+ *ndpi_struct, struct ndpi_flow_struct *flow) {
+ char name[64];
+ u_int off = flow->packet.payload[12] == 0x20 ? 12 : 14;
+
+- if(ndpi_netbios_name_interpret((char*)&flow->packet.payload[off], name, sizeof(name)) > 0)
++ if(ndpi_netbios_name_interpret((char*)&flow->packet.payload[off], flow->packet.payload_packet_len - off, name, sizeof(name)) > 0)
+ snprintf((char*)flow->host_server_name, sizeof(flow->host_server_name)-1, "%s", name);
+
+ ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NETBIOS, NDPI_PROTOCOL_UNKNOWN);
diff --git a/net-libs/nDPI/files/nDPI-3.2-0003-Fixed-invalid-allocation.patch b/net-libs/nDPI/files/nDPI-3.2-0003-Fixed-invalid-allocation.patch
new file mode 100644
index 000000000000..ba8353eef98f
--- /dev/null
+++ b/net-libs/nDPI/files/nDPI-3.2-0003-Fixed-invalid-allocation.patch
@@ -0,0 +1,22 @@
+From cd4f8051ddfd1bae53393174462c823cf5e15ec0 Mon Sep 17 00:00:00 2001
+From: Luca Deri <deri@ntop.org>
+Date: Tue, 24 Mar 2020 13:39:12 +0100
+Subject: [PATCH] Fixed invalid allocation
+
+---
+ src/lib/protocols/ssh.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/lib/protocols/ssh.c b/src/lib/protocols/ssh.c
+index f3b50b60..6813b2a9 100644
+--- a/src/lib/protocols/ssh.c
++++ b/src/lib/protocols/ssh.c
+@@ -294,7 +294,7 @@ static void ndpi_search_ssh_tcp(struct ndpi_detection_module_struct *ndpi_struct
+ ndpi_MD5_CTX ctx;
+
+ if(msgcode == 20 /* key exchange init */) {
+- char *hassh_buf = calloc(packet->payload_packet_len, sizeof(char));
++ char *hassh_buf = ndpi_calloc(packet->payload_packet_len, sizeof(char));
+ u_int i, len;
+
+ #ifdef SSH_DEBUG
diff --git a/net-libs/nDPI/files/nDPI-3.2-0004-Fix-for-serialization-of-strings-where-the-first-element-is-a-zero-le.patch b/net-libs/nDPI/files/nDPI-3.2-0004-Fix-for-serialization-of-strings-where-the-first-element-is-a-zero-le.patch
new file mode 100644
index 000000000000..04f264d52ddd
--- /dev/null
+++ b/net-libs/nDPI/files/nDPI-3.2-0004-Fix-for-serialization-of-strings-where-the-first-element-is-a-zero-le.patch
@@ -0,0 +1,208 @@
+From 60e3ac6b39cb25c974785b8ccc49edaae458a891 Mon Sep 17 00:00:00 2001
+From: Luca Deri <deri@ntop.org>
+Date: Fri, 3 Apr 2020 15:31:23 +0200
+Subject: [PATCH] Fix for serialization of strings where the first element is a
+ zero len string
+
+---
+ src/include/ndpi_typedefs.h | 10 ++++++----
+ src/lib/ndpi_serializer.c | 36 +++++++++++++++++++++++++++++++-----
+ 2 files changed, 37 insertions(+), 9 deletions(-)
+
+diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h
+index 98b8ccf8..2c513e26 100644
+--- a/src/include/ndpi_typedefs.h
++++ b/src/include/ndpi_typedefs.h
+@@ -1446,10 +1446,12 @@ typedef enum {
+ #define NDPI_SERIALIZER_DEFAULT_BUFFER_SIZE 8192
+ #define NDPI_SERIALIZER_DEFAULT_BUFFER_INCR 1024
+
+-#define NDPI_SERIALIZER_STATUS_COMMA (1 << 0)
+-#define NDPI_SERIALIZER_STATUS_ARRAY (1 << 1)
+-#define NDPI_SERIALIZER_STATUS_EOR (1 << 2)
+-#define NDPI_SERIALIZER_STATUS_SOB (1 << 3)
++#define NDPI_SERIALIZER_STATUS_COMMA (1 << 0)
++#define NDPI_SERIALIZER_STATUS_ARRAY (1 << 1)
++#define NDPI_SERIALIZER_STATUS_EOR (1 << 2)
++#define NDPI_SERIALIZER_STATUS_SOB (1 << 3)
++#define NDPI_SERIALIZER_STATUS_NOT_EMPTY (1 << 4)
++
+
+ typedef struct {
+ u_int32_t flags;
+diff --git a/src/lib/ndpi_serializer.c b/src/lib/ndpi_serializer.c
+index 80221005..57c61604 100644
+--- a/src/lib/ndpi_serializer.c
++++ b/src/lib/ndpi_serializer.c
+@@ -43,6 +43,14 @@
+
+ /* ********************************** */
+
++static u_int8_t ndpi_serialize_is_not_empty(ndpi_serializer *_serializer) {
++ ndpi_private_serializer *serializer = (ndpi_private_serializer*)_serializer;
++
++ return(((serializer->status.flags & NDPI_SERIALIZER_STATUS_NOT_EMPTY) == NDPI_SERIALIZER_STATUS_NOT_EMPTY) ? 1 : 0);
++}
++
++/* ********************************** */
++
+ static u_int64_t ndpi_htonll(u_int64_t v) {
+ union { u_int32_t lv[2]; u_int64_t llv; } u;
+
+@@ -442,14 +450,17 @@ int ndpi_serialize_end_of_record(ndpi_serializer *_serializer) {
+ if(!(serializer->status.flags & NDPI_SERIALIZER_STATUS_ARRAY)) {
+ serializer->buffer[0] = '[';
+ serializer->status.size_used += snprintf((char *) &serializer->buffer[serializer->status.size_used],
+- buff_diff, "]");
++ buff_diff, "]");
+ }
++
+ serializer->status.flags |= NDPI_SERIALIZER_STATUS_ARRAY | NDPI_SERIALIZER_STATUS_EOR;
+ serializer->status.flags &= ~NDPI_SERIALIZER_STATUS_COMMA;
+ } else {
+ serializer->buffer[serializer->status.size_used++] = ndpi_serialization_end_of_record;
+ }
+
++ serializer->status.flags &= ~NDPI_SERIALIZER_STATUS_NOT_EMPTY;
++
+ return(0);
+ }
+
+@@ -556,6 +567,7 @@ int ndpi_serialize_uint32_uint32(ndpi_serializer *_serializer,
+ serializer->buffer[type_offset] = type;
+ }
+
++ serializer->status.flags |= NDPI_SERIALIZER_STATUS_NOT_EMPTY;
+ return(0);
+ }
+
+@@ -607,6 +619,7 @@ int ndpi_serialize_uint32_uint64(ndpi_serializer *_serializer,
+ }
+ }
+
++ serializer->status.flags |= NDPI_SERIALIZER_STATUS_NOT_EMPTY;
+ return(0);
+ }
+
+@@ -660,6 +673,7 @@ int ndpi_serialize_uint32_int32(ndpi_serializer *_serializer,
+ serializer->buffer[type_offset] = type;
+ }
+
++ serializer->status.flags |= NDPI_SERIALIZER_STATUS_NOT_EMPTY;
+ return(0);
+ }
+
+@@ -713,6 +727,7 @@ int ndpi_serialize_uint32_int64(ndpi_serializer *_serializer,
+ }
+ }
+
++ serializer->status.flags |= NDPI_SERIALIZER_STATUS_NOT_EMPTY;
+ return(0);
+ }
+
+@@ -761,6 +776,7 @@ int ndpi_serialize_uint32_float(ndpi_serializer *_serializer,
+ serializer->buffer[type_offset] = type;
+ }
+
++ serializer->status.flags |= NDPI_SERIALIZER_STATUS_NOT_EMPTY;
+ return(0);
+ }
+
+@@ -811,6 +827,7 @@ static int ndpi_serialize_uint32_binary(ndpi_serializer *_serializer,
+ serializer->buffer[type_offset] = type;
+ }
+
++ serializer->status.flags |= NDPI_SERIALIZER_STATUS_NOT_EMPTY;
+ return(0);
+ }
+
+@@ -851,6 +868,7 @@ int ndpi_serialize_uint32_boolean(ndpi_serializer *_serializer,
+ value ? "true" : "false");
+ }
+
++ serializer->status.flags |= NDPI_SERIALIZER_STATUS_NOT_EMPTY;
+ return(0);
+ }
+
+@@ -908,6 +926,8 @@ static int ndpi_serialize_binary_int32(ndpi_serializer *_serializer,
+ }
+ }
+
++ serializer->status.flags |= NDPI_SERIALIZER_STATUS_NOT_EMPTY;
++
+ return(0);
+ }
+
+@@ -967,6 +987,7 @@ int ndpi_serialize_binary_int64(ndpi_serializer *_serializer,
+ }
+ }
+
++ serializer->status.flags |= NDPI_SERIALIZER_STATUS_NOT_EMPTY;
+ return(0);
+ }
+
+@@ -1030,6 +1051,7 @@ static int ndpi_serialize_binary_uint32(ndpi_serializer *_serializer,
+ }
+ }
+
++ serializer->status.flags |= NDPI_SERIALIZER_STATUS_NOT_EMPTY;
+ return(0);
+ }
+
+@@ -1056,7 +1078,7 @@ int ndpi_serialize_string_uint32_format(ndpi_serializer *_serializer,
+ return(ndpi_serialize_string_uint32(_serializer, key, value));
+ } else {
+ char buf[16];
+-
++
+ snprintf(buf, sizeof(buf), format, value);
+ return(ndpi_serialize_string_string(_serializer, key, buf));
+ }
+@@ -1111,6 +1133,7 @@ static int ndpi_serialize_binary_uint64(ndpi_serializer *_serializer,
+ }
+ }
+
++ serializer->status.flags |= NDPI_SERIALIZER_STATUS_NOT_EMPTY;
+ return(0);
+ }
+
+@@ -1174,6 +1197,7 @@ static int ndpi_serialize_binary_float(ndpi_serializer *_serializer,
+ ndpi_serialize_single_float(serializer, value);
+ }
+
++ serializer->status.flags |= NDPI_SERIALIZER_STATUS_NOT_EMPTY;
+ return(0);
+ }
+
+@@ -1232,8 +1256,8 @@ static int ndpi_serialize_binary_raw(ndpi_serializer *_serializer,
+ ndpi_serialize_json_post(_serializer);
+ } else if(serializer->fmt == ndpi_serialization_format_csv) {
+ serializer->status.size_used += snprintf((char *) &serializer->buffer[serializer->status.size_used], buff_diff,
+- "%s%s", (serializer->status.size_used > 0) ? serializer->csv_separator : "",
+- value);
++ "%s%s", ndpi_serialize_is_not_empty(_serializer) ? serializer->csv_separator : "",
++ value);
+ } else {
+ serializer->buffer[serializer->status.size_used++] = (ndpi_serialization_string << 4) | ndpi_serialization_string;
+
+@@ -1241,6 +1265,7 @@ static int ndpi_serialize_binary_raw(ndpi_serializer *_serializer,
+ ndpi_serialize_single_string(serializer, value, vlen);
+ }
+
++ serializer->status.flags |= NDPI_SERIALIZER_STATUS_NOT_EMPTY;
+ return(0);
+ }
+
+@@ -1320,10 +1345,11 @@ int ndpi_serialize_string_boolean(ndpi_serializer *_serializer,
+ ndpi_serialize_json_post(_serializer);
+ } else if(serializer->fmt == ndpi_serialization_format_csv) {
+ serializer->status.size_used += snprintf((char *) &serializer->buffer[serializer->status.size_used], buff_diff,
+- "%s%s", (serializer->status.size_used > 0) ? serializer->csv_separator : "",
++ "%s%s", ndpi_serialize_is_not_empty(_serializer) ? serializer->csv_separator : "",
+ value ? "true" : "false");
+ }
+
++ serializer->status.flags |= NDPI_SERIALIZER_STATUS_NOT_EMPTY;
+ return(0);
+ }
+
diff --git a/net-libs/nDPI/nDPI-3.2.ebuild b/net-libs/nDPI/nDPI-3.2-r1.ebuild
index 012aff2f4458..a83b9c1dce9c 100644
--- a/net-libs/nDPI/nDPI-3.2.ebuild
+++ b/net-libs/nDPI/nDPI-3.2-r1.ebuild
@@ -20,6 +20,13 @@ DEPEND="
RDEPEND="
${DEPEND}
"
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.2-0000-Check-NULL-strings-in-ndpi_serialize_string_string.patch
+ "${FILESDIR}"/${PN}-3.2-0001-Added-fix-for-serialization-loop.patch
+ "${FILESDIR}"/${PN}-3.2-0002-Refresh-of-ndpi_netbios_name_interpret.patch
+ "${FILESDIR}"/${PN}-3.2-0003-Fixed-invalid-allocation.patch
+ "${FILESDIR}"/${PN}-3.2-0004-Fix-for-serialization-of-strings-where-the-first-element-is-a-zero-le.patch
+)
src_prepare() {
eval $(grep '^NDPI_MAJOR=' autogen.sh)