فهرست منبع

http_async_client: remove unnecessary str len

(cherry picked from commit c36dd7e9c8b01aae5f35e8c576188cd34b1f8aa6)
Daniel-Constantin Mierla 9 ماه پیش
والد
کامیت
40a9c5a96d
2فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 1 1
      src/modules/http_async_client/async_http.c
  2. 2 2
      src/modules/http_async_client/http_multi.c

+ 1 - 1
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) {

+ 2 - 2
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);
 
@@ -220,7 +220,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;