From: Seungbae Shin Date: Thu, 11 Jul 2024 12:23:49 +0000 (+0900) Subject: Fix SVACE defects (LIB.INSECURE_STRNCMP) X-Git-Tag: accepted/tizen/unified/20240712.160134^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=26a62a2894cfe3316e2889ee91cf38ae1d82be5f;p=platform%2Fcore%2Fmultimedia%2Fpulseaudio-modules-tizen.git Fix SVACE defects (LIB.INSECURE_STRNCMP) [Version] 15.0.79 [Issue Type] SVACE Change-Id: I5332ff769e00daaf718798cf198930bd8dea15c2 --- diff --git a/packaging/pulseaudio-modules-tizen.spec b/packaging/pulseaudio-modules-tizen.spec index 6d1ee80..6f60cf6 100644 --- a/packaging/pulseaudio-modules-tizen.spec +++ b/packaging/pulseaudio-modules-tizen.spec @@ -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+ diff --git a/src/stream-manager-dbus.c b/src/stream-manager-dbus.c index fb0c17e..7d1691d 100644 --- a/src/stream-manager-dbus.c +++ b/src/stream-manager-dbus.c @@ -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); diff --git a/src/stream-manager-filter.c b/src/stream-manager-filter.c index 8702c58..5eca7c8 100644 --- a/src/stream-manager-filter.c +++ b/src/stream-manager-filter.c @@ -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, diff --git a/src/stream-manager-volume.c b/src/stream-manager-volume.c index 470c325..a705a99 100644 --- a/src/stream-manager-volume.c +++ b/src/stream-manager-volume.c @@ -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); diff --git a/src/vconf/vconf-helper.c b/src/vconf/vconf-helper.c index f7f8f41..6a03a9e 100644 --- a/src/vconf/vconf-helper.c +++ b/src/vconf/vconf-helper.c @@ -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'. */