audio: hal and post_proc KW and misc fixes

- KWBUG-811 fixes for NULL check and correct
pointer dereferece in HAL and post_proc

- KWBUG-813, KWBUG-883 fixes for strtok,
strcpy, strncpy strcat, strncat etc.

Conflicts:
	hal/audio_extn/utils.c
	hal/msm8974/platform.c
	post_proc/effect_api.c
Change-Id: I1a9626a7951aa3d54fb2d92a9167e5f92b5f523f
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index 9c1115c..58e9565 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -2647,6 +2647,11 @@
         bool status = false;
         str_parms_del(parms, AUDIO_PARAMETER_KEY_EXT_AUDIO_DEVICE);
         event_name = strtok_r(value, ",", &status_str);
+        if (!event_name) {
+            ret = -EINVAL;
+            ALOGE("%s: event_name is NULL", __func__);
+            goto done;
+        }
         ALOGV("%s: recieved update of external audio device %s %s",
                          __func__,
                          event_name, status_str);
@@ -3441,7 +3446,7 @@
 int platform_set_channel_map(void *platform, int ch_count, char *ch_map, int snd_id)
 {
     struct mixer_ctl *ctl;
-    char mixer_ctl_name[44]; // max length of name is 44 as defined
+    char mixer_ctl_name[44] = {0}; // max length of name is 44 as defined
     int ret;
     unsigned int i;
     int set_values[8] = {0};