aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/http.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2020-09-22 08:56:35 +0200
committerLuca Deri <deri@ntop.org>2020-09-22 08:56:35 +0200
commit5f99433ee75cd6acc4e73fd9de132b138be12a50 (patch)
treef9c9fcdc3ce6bbfcf245b32bf82d11c1c70b49bd /src/lib/protocols/http.c
parent27bad147381866f957d12ade241c58768dae418a (diff)
Minor UA handling improvement to avoid heap-overflow
Diffstat (limited to 'src/lib/protocols/http.c')
-rw-r--r--src/lib/protocols/http.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c
index 983a53b1c..2cc42edad 100644
--- a/src/lib/protocols/http.c
+++ b/src/lib/protocols/http.c
@@ -347,7 +347,7 @@ int http_process_user_agent(struct ndpi_detection_module_struct *ndpi_struct,
flow->http.user_agent = ndpi_malloc(len);
if(flow->http.user_agent) {
- strncpy(flow->http.user_agent, (char*)ua_ptr, ua_ptr_len);
+ memcpy(flow->http.user_agent, (char*)ua_ptr, ua_ptr_len);
flow->http.user_agent[ua_ptr_len] = '\0';
ndpi_check_user_agent(ndpi_struct, flow, flow->http.user_agent);