diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2023-06-26 11:41:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-26 11:41:01 +0200 |
commit | 3a1600ff26d02a3440186a6e8355521086a7e11f (patch) | |
tree | 95743b96bf47693f1997f80cb2c4f92a49c34c75 /src/lib/protocols | |
parent | 7ef80f6b78e882129f47bb9e09e67d53690cba2f (diff) |
Thrift: fix heap-buffer-overflow (#2024)
Diffstat (limited to 'src/lib/protocols')
-rw-r--r-- | src/lib/protocols/thrift.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/protocols/thrift.c b/src/lib/protocols/thrift.c index 344795523..92f003781 100644 --- a/src/lib/protocols/thrift.c +++ b/src/lib/protocols/thrift.c @@ -120,7 +120,7 @@ static void thrift_set_method(struct ndpi_detection_module_struct *ndpi_struct, ndpi_set_risk(ndpi_struct, flow, NDPI_INVALID_CHARACTERS, "Invalid method name"); flow->protos.thrift.method[0] = '\0'; } else { - strncpy(flow->protos.thrift.method, method, method_length); + strncpy(flow->protos.thrift.method, method, ndpi_min(sizeof(flow->protos.thrift.method), method_length)); } } |