Explorar o código

qcacmn: Validate the network buffer before processing

Check for potential buffer overflow and NULL ptr access
issues.

Change-Id: Iecb36530716dafa27a95a82392e97f662a7c25f0
CRs-Fixed: 2251345
Amar Singhal %!s(int64=6) %!d(string=hai) anos
pai
achega
f98d926bcf
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      qdf/linux/src/qdf_trace.c

+ 2 - 1
qdf/linux/src/qdf_trace.c

@@ -1890,7 +1890,8 @@ void qdf_dp_trace_data_pkt(qdf_nbuf_t nbuf, uint8_t pdev_id,
 		return;
 
 	qdf_dp_add_record(code, pdev_id,
-			  qdf_nbuf_data(nbuf), nbuf->len - nbuf->data_len,
+			  nbuf ? qdf_nbuf_data(nbuf) : NULL,
+			  nbuf ? nbuf->len - nbuf->data_len : 0,
 			  (uint8_t *)&buf, sizeof(struct qdf_dp_trace_data_buf),
 			  (nbuf) ? QDF_NBUF_CB_DP_TRACE_PRINT(nbuf) : false);
 }