Fix static analysis issues
[platform/core/security/drm-service-core-tizen.git] / tadcore / TADCCore / TADC_Core.cpp
index a3b55f4..b2d8046 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2000-2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Flora License, Version 1.1 (the License);
  * you may not use this file except in compliance with the License.
@@ -1055,7 +1055,9 @@ int TADC_GetFileHeader(unsigned char *inBuffer,  T_FILE_HEADER *t_FileHeader)
        t_FileHeader->DRMType = inBuffer[i];
        i += 1;
 
-       TADC_IF_MemCpy(t_FileHeader->ContentsType, inBuffer + i, 128);
+       // ContentsType is treated as null-terminated string, hence 127
+       // (zero is added in memset in line 1024)
+       TADC_IF_MemCpy(t_FileHeader->ContentsType, inBuffer + i, 127);
        i += 128;
 
        TADC_IF_MemCpy(&t_FileHeader->TotalSize, inBuffer + i, 8);