mirror of https://github.com/citusdata/citus.git
Fix strlcpy off-by-one error
WORKER_LENGTH + 1 is too large. Fixing this has no impact on the string that is ultimately copied, as it's impossible for the source string to be any larger to begin with.pull/406/head
parent
f9e2e50e4f
commit
1eebb9a6c3
|
@ -723,8 +723,8 @@ ParseWorkerNodeFile(const char *workerNodeFilename)
|
|||
/* allocate worker node structure and set fields */
|
||||
workerNode = (WorkerNode *) palloc0(sizeof(WorkerNode));
|
||||
|
||||
strlcpy(workerNode->workerName, nodeName, WORKER_LENGTH + 1);
|
||||
strlcpy(workerNode->workerRack, nodeRack, WORKER_LENGTH + 1);
|
||||
strlcpy(workerNode->workerName, nodeName, WORKER_LENGTH);
|
||||
strlcpy(workerNode->workerRack, nodeRack, WORKER_LENGTH);
|
||||
workerNode->workerPort = nodePort;
|
||||
workerNode->inWorkerFile = true;
|
||||
|
||||
|
|
Loading…
Reference in New Issue