[KW] Fix critical KW issues in intel_fw_logging.c
authorChristophe Guerard <christophe.guerard@intel.com>
Tue, 28 Feb 2012 15:23:58 +0000 (16:23 +0100)
committerbuildbot <buildbot@intel.com>
Tue, 28 Feb 2012 23:41:54 +0000 (15:41 -0800)
BZ: 23929

Change-Id: I459dd5f6ddb33bc7fa14c195187641af36164f3f
Signed-off-by: Christophe Guerard <christophe.guerard@intel.com>
Reviewed-on: http://android.intel.com:8080/36874
Reviewed-by: Monroy, German <german.monroy@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/misc/intel_fw_logging.c

index e3a764f..a77e8ec 100755 (executable)
@@ -234,10 +234,10 @@ static void get_additional_error(char *buf, int num_err_log,
                                sprintf(str, "Unknown agent index (%d)\n",
                                        log.fields.agent_idx);
                        else
-                               sprintf(str, "%s\n",
+                               snprintf(str, sizeof(str)-1, "%s\n",
                                        Agent_Names[log.fields.agent_idx]);
 
-                       sprintf(temp, "Agent Index: %s\n", str);
+                       snprintf(temp, sizeof(temp)-1, "Agent Index:%s\n", str);
                        strcat(buf, temp);
 
                        sprintf(temp, "Cmd initiator ID: %d\n",