Skip to content

Commit

Permalink
Merge pull request taosdata#12824 from ideal/develop
Browse files Browse the repository at this point in the history
fix: potential overflow of pThread->label
  • Loading branch information
guanshengliang authored Oct 22, 2022
2 parents 3cc132b + bf9b9ac commit 2a660b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/plugins/http/inc/httpInt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/http/src/httpServer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 2a660b0

Please sign in to comment.