Accepting request 888209 from server:monitoring

OBS-URL: https://build.opensuse.org/request/show/888209
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/ndpi?expand=0&rev=9
This commit is contained in:
Dominique Leuenberger 2021-04-24 21:09:24 +00:00 committed by Git OBS Bridge
commit f87218238b
5 changed files with 12 additions and 84 deletions

View File

@ -1,77 +0,0 @@
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);
--
2.26.1

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6808c8c4495343e67863f4d30bb261c1e2daec5628ae0be257ba2a2dea7ec70a
size 29586049

3
ndpi-3.4.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:dc9b291c7fde94edb45fb0f222e0d93c93f8d6d37f4efba20ebd9c655bfcedf9
size 37976087

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Apr 23 14:57:05 UTC 2021 - Mathias Homann <Mathias.Homann@opensuse.org>
- Update to 3.4
* removed 001-Refresh-of-ndpi_netbios_name_interpret.patch, implemented
upstream
-------------------------------------------------------------------
Fri Apr 24 17:25:05 UTC 2020 - Petr Cervinka <petr@cervinka.net>

View File

@ -1,7 +1,7 @@
#
# spec file for package ndpi
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2017, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
@ -23,7 +23,7 @@
%define sover 3
Name: ndpi
Version: 3.2
Version: 3.4
Release: 0
Summary: Extensible deep packet inspection library
# wireshark/ndpi.lua is GPL-3.0-or-later
@ -31,7 +31,6 @@ License: LGPL-3.0-only
Group: Development/Libraries/C and C++
URL: https://github.com/ntop/nDPI
Source: https://github.com/ntop/nDPI/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: 001-Refresh-of-ndpi_netbios_name_interpret.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gcc-c++
@ -89,7 +88,6 @@ This package contains the ndpiReader binary.
%prep
%setup -q -n nDPI-%{version}
%patch0 -p1
%build
sh autogen.sh