Module: kamailio
Branch: master
Commit: c36dd7e9c8b01aae5f35e8c576188cd34b1f8aa6
URL:
https://github.com/kamailio/kamailio/commit/c36dd7e9c8b01aae5f35e8c576188cd…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-11-28T10:51:56+01:00
http_async_client: remove unnecessary str len
---
Modified: src/modules/http_async_client/async_http.c
Modified: src/modules/http_async_client/http_multi.c
---
Diff:
https://github.com/kamailio/kamailio/commit/c36dd7e9c8b01aae5f35e8c576188cd…
Patch:
https://github.com/kamailio/kamailio/commit/c36dd7e9c8b01aae5f35e8c576188cd…
---
diff --git a/src/modules/http_async_client/async_http.c
b/src/modules/http_async_client/async_http.c
index 1dbe8adc5c1..2ece3a9dd32 100644
--- a/src/modules/http_async_client/async_http.c
+++ b/src/modules/http_async_client/async_http.c
@@ -522,7 +522,7 @@ int async_send_query(sip_msg_t *msg, str *query, str *cbname)
q_idx++;
snprintf(q_id, MAX_ID_LEN + 1, "%u-%u", (unsigned int)getpid(), q_idx);
- strncpy(aq->id, q_id, strlen(q_id));
+ strcpy(aq->id, q_id);
aq->query_params.tls_client_cert = NULL;
if(ah_params.tls_client_cert) {
diff --git a/src/modules/http_async_client/http_multi.c
b/src/modules/http_async_client/http_multi.c
index a57aba9c951..daceb932ec9 100644
--- a/src/modules/http_async_client/http_multi.c
+++ b/src/modules/http_async_client/http_multi.c
@@ -100,7 +100,7 @@ void event_cb(int fd, short kind, void *userp)
update_stat(timeouts, 1);
const char *error = "TIMEOUT";
- strncpy(cell->error, error, strlen(error) + 1);
+ strcpy(cell->error, error);
reply_error(cell);
@@ -218,7 +218,7 @@ int check_mcode(CURLMcode code, char *error)
break;
}
LM_ERR("ERROR: %s\n", s);
- strncpy(error, s, strlen(s) + 1);
+ strcpy(error, s);
return -1;
}
return 0;