Fix SVACE defects (LIB.INSECURE_STRNCMP) 35/314435/1 accepted/tizen/unified/20240712.160134 accepted/tizen/unified/dev/20240715.080541 accepted/tizen/unified/x/20240715.042521
authorSeungbae Shin <seungbae.shin@samsung.com>
Thu, 11 Jul 2024 12:23:49 +0000 (21:23 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Thu, 11 Jul 2024 12:24:40 +0000 (21:24 +0900)
[Version] 15.0.79
[Issue Type] SVACE

Change-Id: I5332ff769e00daaf718798cf198930bd8dea15c2

packaging/pulseaudio-modules-tizen.spec
src/stream-manager-dbus.c
src/stream-manager-filter.c
src/stream-manager-volume.c
src/vconf/vconf-helper.c

index 6d1ee8017d0a4eb52a99b5ff37680a47cce21f46..6f60cf64545f5994aa6538d30d5e4d06af32f7fb 100644 (file)
@@ -2,7 +2,7 @@
 
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          15.0.78
+Version:          15.0.79
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index fb0c17ecc84fe9928d39eaaeeaf57467a15b8c90..7d1691dc53b662b8889a730e43786368d05cb2b7 100644 (file)
@@ -1781,11 +1781,11 @@ static int32_t parse_call_parameters(const char *parameters, char *call_type, ch
         strncpy(key, token, delimiter_ptr - token);
         value = delimiter_ptr + 1;
         pa_log_debug("key(%s), value(%s)", key, value);
-        if (!strncmp(key, "call-type", strlen("call-type")))
+        if (pa_safe_streq(key, "call-type"))
             pa_strlcpy(call_type, value, MAX_CALL_PARAM_SIZE);
-        else if (!strncmp(key, "call-domain", strlen("call-domain")))
+        else if (pa_safe_streq(key, "call-domain"))
             pa_strlcpy(call_domain, value, MAX_CALL_PARAM_SIZE);
-        else if (!strncmp(key, "network-band", strlen("network-band")))
+        else if (pa_safe_streq(key, "network-band"))
             pa_strlcpy(network_band, value, MAX_CALL_PARAM_SIZE);
         else
             pa_log_warn("not supported key(%s)", key);
index 8702c582980d8c285e3695d1be47e783f682e897..5eca7c8a5244cabb9ed42090eb06334bad47189e 100644 (file)
@@ -297,7 +297,7 @@ static void update_filter_parameters(filter_info *f) {
 
     while ((param_element = pa_split(f->parameters, " ", &split_state))) {
         len = strlen(result_buf);
-        if (!strncmp(param_element, control_element, strlen(control_element))) {
+        if (pa_safe_streq(param_element, control_element)) {
             for (i = 0; i < f->n_controls; i++) {
                 c_len = strlen(control_values);
                 pa_snprintf(control_values + c_len, MAX_ELEMENT_LENGTH - c_len,
index 470c325cccc185a015aabf7d4b2c50b34070b18c..a705a99c86c6c9271faca8492fa906ad27f71e39 100644 (file)
@@ -113,7 +113,7 @@ static int load_out_volume_conf_file(pa_stream_manager *m) {
                     /* convert dB volume to linear volume */
                     double *vol_value = pa_xmalloc0(sizeof(double));
                     *vol_value = 0.0f;
-                    if (strncmp(token, "0", strlen(token)))
+                    if (!pa_safe_streq(token, "0"))
                         *vol_value = pow(10.0, (atof(token) - 100) / 20.0);
                     if (!v->values[STREAM_DIRECTION_OUT].idx_volume_values)
                         v->values[STREAM_DIRECTION_OUT].idx_volume_values = pa_idxset_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
index f7f8f414daf4624e523ffe459fd1e758a5dc2449..6a03a9e036f3540ae76fa6078b9a1b103e7083be 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]))) {
+    if (pa_safe_streq(vconf_keynode_get_name(key), 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'. */