From a300adf15342aa4d3b030698d40d61edb6272ea0 Mon Sep 17 00:00:00 2001
From: fujuntang <fujuntang@smartai.com>
Date: 星期二, 07 九月 2021 11:51:20 +0800
Subject: [PATCH] resize the buf allocation as dynamic allocate.

---
 src/socket/bus_server_socket.cpp |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/socket/bus_server_socket.cpp b/src/socket/bus_server_socket.cpp
index 1646da5..8b022e1 100644
--- a/src/socket/bus_server_socket.cpp
+++ b/src/socket/bus_server_socket.cpp
@@ -298,7 +298,7 @@
 
 void BusServerSocket::_proxy_reg(const char *topic, size_t topic_size, const char *buf, size_t buf_size, int key, int flag)
 {
-  char buf_temp[MAX_STR_LEN] = { 0x00 };
+  char buf_temp[MAX_STR_LEN * MAX_TOPICS_NUN] = { 0x00 };
   int count = 0;
   int i = 0;
   int len = 0;
@@ -676,7 +676,6 @@
   int flag;
 	char * action, *topic, *topics, *buf, *content;
 	size_t head_len;
-	char resp_buf[128];
 	bus_head_t head;
 
   int rv;

--
Gitblit v1.8.0