Fix some vulnerability (Null Pointer Dereference) defects
[platform/core/multimedia/libmm-sound.git] / mm_sound_device.c
index c9ef5f0..ad2fa62 100644 (file)
@@ -30,8 +30,8 @@
 
 #define VOLUME_TYPE_LEN 64
 
-mm_sound_device_list_t g_device_list;
-pthread_mutex_t g_thread_mutex = PTHREAD_MUTEX_INITIALIZER;
+static mm_sound_device_list_t g_device_list;
+static pthread_mutex_t g_thread_mutex = PTHREAD_MUTEX_INITIALIZER;
 
 static int _check_for_valid_mask(int flags)
 {
@@ -91,8 +91,8 @@ static int __convert_device_type_to_enum(char *device_type, mm_sound_device_type
                *device_type_enum = MM_SOUND_DEVICE_TYPE_MIRRORING;
        } else if (!strncmp(device_type, "usb-audio", VOLUME_TYPE_LEN)) {
                *device_type_enum = MM_SOUND_DEVICE_TYPE_USB_AUDIO;
-       } else if (!strncmp(device_type, "raop", VOLUME_TYPE_LEN)) {
-               *device_type_enum = MM_SOUND_DEVICE_TYPE_RAOP;
+       } else if (!strncmp(device_type, "network", VOLUME_TYPE_LEN)) {
+               *device_type_enum = MM_SOUND_DEVICE_TYPE_NETWORK;
        } else {
                ret = MM_ERROR_INVALID_ARGUMENT;
                debug_error("not supported device_type(%s), err(0x%08x)", device_type, ret);