diff --git a/src/plugins/http/inc/httpInt.h b/src/plugins/http/inc/httpInt.h index 2aa01244c687..52b83c026049 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 c00d8bdebdce..fb3c16824ff8 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;