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
Jason Petersen 2016-03-23 17:34:34 -06:00
parent f9e2e50e4f
commit 1eebb9a6c3
No known key found for this signature in database
GPG Key ID: 9F1D3510D110ABA9
1 changed files with 2 additions and 2 deletions

View File

@ -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;