CFDP SOURCE handler #157
@ -169,6 +169,10 @@ ReturnValue_t cfdp::SourceHandler::transactionStart(PutRequest& putRequest, Remo
|
|||||||
const char* destNamePtr = putRequest.getDestName().getCString(transactionParams.destNameSize);
|
const char* destNamePtr = putRequest.getDestName().getCString(transactionParams.destNameSize);
|
||||||
std::strncpy(transactionParams.sourceName.data(), srcNamePtr, transactionParams.sourceNameSize);
|
std::strncpy(transactionParams.sourceName.data(), srcNamePtr, transactionParams.sourceNameSize);
|
||||||
std::strncpy(transactionParams.destName.data(), destNamePtr, transactionParams.destNameSize);
|
std::strncpy(transactionParams.destName.data(), destNamePtr, transactionParams.destNameSize);
|
||||||
|
// Add 0 termination. The source and dest name size can not be larger than UINT8_MAX, so this
|
||||||
|
// operation is safe.
|
||||||
|
transactionParams.sourceName[transactionParams.sourceNameSize] = '\0';
|
||||||
|
transactionParams.destName[transactionParams.destNameSize] = '\0';
|
||||||
FilesystemParams params(transactionParams.sourceName.data());
|
FilesystemParams params(transactionParams.sourceName.data());
|
||||||
if (!sourceParams.user.vfs.fileExists(params)) {
|
if (!sourceParams.user.vfs.fileExists(params)) {
|
||||||
return FILE_DOES_NOT_EXIST;
|
return FILE_DOES_NOT_EXIST;
|
||||||
|
Loading…
Reference in New Issue
Block a user