Loading media/mtp/MtpServer.cpp +13 −1 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ #include "MtpStringBuffer.h" namespace android { static const int SN_EVENT_LOG_ID = 0x534e4554; static const MtpOperationCode kSupportedOperationCodes[] = { MTP_OPERATION_GET_DEVICE_INFO, Loading Loading @@ -961,9 +962,20 @@ MtpResponseCode MtpServer::doSendObjectInfo() { if (!parseDateTime(modified, modifiedTime)) modifiedTime = 0; if ((strcmp(name, ".") == 0) || (strcmp(name, "..") == 0) || (strcmp(name, "/") == 0) || (strcmp(basename(name), name) != 0)) { char errMsg[80]; sprintf(errMsg, "Invalid name: %s", (const char *) name); ALOGE("%s (b/130656917)", errMsg); android_errorWriteWithInfoLog(SN_EVENT_LOG_ID, "130656917", -1, errMsg, strlen(errMsg)); return MTP_RESPONSE_INVALID_PARAMETER; } if (path[path.size() - 1] != '/') path.append("/"); path.append(name); path.append(basename(name)); // check space first if (mSendObjectFileSize > storage->getFreeSpace()) Loading Loading
media/mtp/MtpServer.cpp +13 −1 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ #include "MtpStringBuffer.h" namespace android { static const int SN_EVENT_LOG_ID = 0x534e4554; static const MtpOperationCode kSupportedOperationCodes[] = { MTP_OPERATION_GET_DEVICE_INFO, Loading Loading @@ -961,9 +962,20 @@ MtpResponseCode MtpServer::doSendObjectInfo() { if (!parseDateTime(modified, modifiedTime)) modifiedTime = 0; if ((strcmp(name, ".") == 0) || (strcmp(name, "..") == 0) || (strcmp(name, "/") == 0) || (strcmp(basename(name), name) != 0)) { char errMsg[80]; sprintf(errMsg, "Invalid name: %s", (const char *) name); ALOGE("%s (b/130656917)", errMsg); android_errorWriteWithInfoLog(SN_EVENT_LOG_ID, "130656917", -1, errMsg, strlen(errMsg)); return MTP_RESPONSE_INVALID_PARAMETER; } if (path[path.size() - 1] != '/') path.append("/"); path.append(name); path.append(basename(name)); // check space first if (mSendObjectFileSize > storage->getFreeSpace()) Loading