• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/bt


Commit MetaInfo

Revisão278dab1f8c0f498a0ddc65911527adc043bade2b (tree)
Hora2018-10-08 17:42:13
AutorUgo Yu <ugoyu@goog...>
CommiterVasyl Gello

Mensagem de Log

Add packet length check in smp_proc_master_id

Bug: 111937027
Test: manual

Change-Id: I1144c9879e84fa79d68ad9d5fece4f58e2a3b075
(cherry picked from commit c8294662d07a98e9b8b1cab1ab681ec0805ce4e8)

Mudança Sumário

Diff

--- a/stack/smp/smp_act.c
+++ b/stack/smp/smp_act.c
@@ -1033,6 +1033,16 @@ void smp_proc_master_id(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
10331033 tBTM_LE_PENC_KEYS le_key;
10341034
10351035 SMP_TRACE_DEBUG("%s", __func__);
1036+
1037+ if (p_cb->rcvd_cmd_len < 11)
1038+ {
1039+ // 1(Code) + 2(EDIV) + 8(Rand)
1040+ android_errorWriteLog(0x534e4554, "111937027");
1041+ SMP_TRACE_ERROR("%s: Invalid command length: %d, should be at least 11",
1042+ __func__, p_cb->rcvd_cmd_len);
1043+ return;
1044+ }
1045+
10361046 smp_update_key_mask (p_cb, SMP_SEC_KEY_TYPE_ENC, TRUE);
10371047
10381048 STREAM_TO_UINT16(le_key.ediv, p);