Fix svace_2.3 defects
[platform/core/security/drm-service-core-tizen.git] / tappsd / src / rights / DTapps2Rights.cpp
index bd97a32..b358350 100644 (file)
@@ -138,7 +138,7 @@ int DTappsInstallLicense(const char *declicbuffer)
        /* Copy DUID */
        if (t_RO.t_Permission.t_Individual.DUID != NULL) {
                DTAPPS_MEMCPY(st_constraints.DUID, t_RO.t_Permission.t_Individual.DUID,
-                                         TAPPS_STRLEN((const char *)t_RO.t_Permission.t_Individual.DUID));
+                                         TAPPS_STRLEN((const char *)t_RO.t_Permission.t_Individual.DUID) + 1);
        }
 
        DRM_TAPPS_LOG("st_constraints.DUID = %s", st_constraints.DUID);
@@ -739,7 +739,7 @@ int DTappsGetROInfo(const char *pszXML, T_RO *t_RO, unsigned char *name)
        }
 
        TADC_IF_MemSet(t_RO->t_Permission.t_Individual.DUID, 0, length + 1);
-       TADC_IF_MemCpy((CHAR *)t_RO->t_Permission.t_Individual.DUID, pszValue, length);
+       TADC_IF_MemCpy((CHAR *)t_RO->t_Permission.t_Individual.DUID, pszValue, length + 1);
 
        nResult = 0;
 
@@ -1314,14 +1314,14 @@ BOOL DTapps_RIGHTS_SELECT_ONE(const char *cid, DTAPPS_RIGHTS_ROW *row)
        name = (char *) sqlite3_column_text(pstmt, dIdx++);
 
        if (name != NULL)
-               memcpy(result->name, name, strlen(name));
+               memcpy(result->name, name, strlen(name) + 1);
 
        DRM_TAPPS_LOG("....SEELECTED : name = %s", result->name);
 
        time = (char *) sqlite3_column_text(pstmt, dIdx++);
 
        if (time != NULL)
-               memcpy(result->time, time, strlen(time));
+               memcpy(result->time, time, strlen(time) + 1);
 
        DRM_TAPPS_LOG("....SEELECTED : time = %s", result->time);
 
@@ -1329,14 +1329,14 @@ BOOL DTapps_RIGHTS_SELECT_ONE(const char *cid, DTAPPS_RIGHTS_ROW *row)
        cek = (char *) sqlite3_column_text(pstmt, dIdx++);
 
        if (cek != NULL)
-               memcpy(result->cek, cek, strlen(cek));
+               memcpy(result->cek, cek, strlen(cek) + 1);
 
        DRM_TAPPS_LOG("....SEELECTED : cek = %s", result->cek);
 
        cek_hash = (char *) sqlite3_column_text(pstmt, dIdx++);
 
        if (cek_hash != NULL)
-               memcpy(result->cek_hash, cek_hash, strlen(cek_hash));
+               memcpy(result->cek_hash, cek_hash, strlen(cek_hash) + 1);
 
        DRM_TAPPS_LOG("....SEELECTED : cek_hash = %s", result->cek_hash);
 #endif
@@ -1344,7 +1344,7 @@ BOOL DTapps_RIGHTS_SELECT_ONE(const char *cid, DTAPPS_RIGHTS_ROW *row)
        constraint_buffer = (char *) sqlite3_column_text(pstmt, dIdx++);
 
        if (constraint_buffer != NULL)
-               memcpy(result->constraint_buffer, constraint_buffer, strlen(constraint_buffer));
+               memcpy(result->constraint_buffer, constraint_buffer, strlen(constraint_buffer) + 1);
 
        DRM_TAPPS_LOG("....SEELECTED : constraint_buffer = %s",
                                  result->constraint_buffer);
@@ -1352,11 +1352,11 @@ BOOL DTapps_RIGHTS_SELECT_ONE(const char *cid, DTAPPS_RIGHTS_ROW *row)
        constraint_hash = (char *) sqlite3_column_text(pstmt, dIdx++);
 
        if (constraint_hash != NULL)
-               memcpy(result->constraint_hash, constraint_hash, strlen(constraint_hash));
+               memcpy(result->constraint_hash, constraint_hash, strlen(constraint_hash) + 1);
 
        DRM_TAPPS_LOG("....SEELECTED : constraint_hash = %s", result->constraint_hash);
 
-       memcpy(result->cid, cid, strlen(cid));
+       memcpy(result->cid, cid, strlen(cid) + 1);
        DRM_TAPPS_LOG("....SEELECTED : cid = %s", result->cid);
 
        DRM_TAPPS_LOG("Release Statement........");