fixup! fixup! Fix SVACE defects (LIB.INSECURE_STRNCMP) 38/314538/1 accepted/tizen/unified/20240715.155447 accepted/tizen/unified/dev/20240716.080847 accepted/tizen/unified/x/20240716.041640
authorSeungbae Shin <seungbae.shin@samsung.com>
Mon, 15 Jul 2024 06:05:54 +0000 (15:05 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Mon, 15 Jul 2024 06:06:10 +0000 (15:06 +0900)
It is comparing prefix only which means the original code was exactly
correct.

Change-Id: I86eaa68f14dae0c96372658204c3e946427254e9

src/vconf/vconf-helper.c

index f04af6f8c69e50bd96297fdb0f1703cee05b3686..f7f8f414daf4624e523ffe459fd1e758a5dc2449 100644 (file)
@@ -46,7 +46,7 @@ static void vconf_callback(keynode_t *key, void *data) {
 
     idx = vitem->prefix;
 
-    if (!strncmp(vconf_keynode_get_name(key), vconf_prefix[idx], strlen(vconf_prefix[idx]) + 1)) {
+    if (!strncmp(vconf_keynode_get_name(key), vconf_prefix[idx], strlen(vconf_prefix[idx]))) {
         snprintf(buf, sizeof(buf), "%c%s", vitem->opcode, vconf_keynode_get_name(key));
         fprintf(stdout, "%s%c", buf, 0);  /* Send opcode + key + '\0'. */