diff --git a/src/plugins/http/inc/httpInt.h b/src/plugins/http/inc/httpInt.h index 2aa01244c6877a8ec614fbe5a2f63f296f3df4f5..52b83c0260496d39aec0fc999c18ec96d1eeb509 100644 --- a/src/plugins/http/inc/httpInt.h +++ b/src/plugins/http/inc/httpInt.h @@ -175,7 +175,7 @@ typedef struct HttpThread { EpollFd pollFd; int32_t numOfContexts; int32_t threadId; - char label[HTTP_LABEL_SIZE << 1]; + char label[HTTP_LABEL_SIZE << 2]; bool (*processData)(HttpContext *pContext); } HttpThread; diff --git a/src/plugins/http/src/httpServer.c b/src/plugins/http/src/httpServer.c index c00d8bdebdcead98943628a22d4b886a03532f15..fb3c16824ff812d9cfec6e49d6e46dc012402f9a 100644 --- a/src/plugins/http/src/httpServer.c +++ b/src/plugins/http/src/httpServer.c @@ -313,7 +313,7 @@ bool httpInitConnect() { HttpThread *pThread = pServer->pThreads; for (int32_t i = 0; i < pServer->numOfThreads; ++i) { - sprintf(pThread->label, "%s%d", pServer->label, i); + snprintf(pThread->label, sizeof(pThread->label), "%s%d", pServer->label, i); pThread->processData = pServer->processData; pThread->threadId = i;