Browse Source

qcacld-3.0: Specify exact size of the version string while coping

While coping version strings in cds_hang_event_notifier_call, specify
exact size of QWLAN_VERSIONSTR/QDF_HANG_EVENT_VERSION to avoid buffer
overflow.

Change-Id: Ie2203600a2c92bb78ba076b609375ca219773b19
CRs-Fixed: 2702069
Bapiraju Alla 4 years ago
parent
commit
2f20b939d1
1 changed files with 4 additions and 2 deletions
  1. 4 2
      core/cds/src/cds_api.c

+ 4 - 2
core/cds/src/cds_api.c

@@ -555,9 +555,11 @@ static int cds_hang_event_notifier_call(struct notifier_block *block,
 
 	cmd->recovery_reason = gp_cds_context->recovery_reason;
 
-	qdf_mem_copy(&cmd->driver_version, QWLAN_VERSIONSTR, 11);
+	qdf_mem_copy(&cmd->driver_version, QWLAN_VERSIONSTR,
+		     sizeof(QWLAN_VERSIONSTR));
 
-	qdf_mem_copy(&cmd->hang_event_version, QDF_HANG_EVENT_VERSION, 3);
+	qdf_mem_copy(&cmd->hang_event_version, QDF_HANG_EVENT_VERSION,
+		     sizeof(QDF_HANG_EVENT_VERSION));
 
 	cds_hang_data->offset += total_len;
 	return NOTIFY_OK;