• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

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

system/bt


Commit MetaInfo

Revisionf049e304c7fd2619ccdddc449e0c13ab7ed7f50e (tree)
Zeit2018-10-17 08:08:50
AutorUgo Yu <ugoyu@goog...>
CommiterRohit Yengisetty

Log Message

DO NOT MERGE - Check SDU lower bound before allocate p_data

Bug: 112321180
Test: SL4A BleCocTest:test_coc_insecured_connection_write_ascii
Change-Id: Id0c9aa2097f0b6bdc2bb9fa9086daa9452188e1d
(cherry picked from commit 87bcda81b8209a71b32351b54cedaad48a7a56b4)

Ändern Zusammenfassung

Diff

--- a/stack/l2cap/l2c_fcr.c
+++ b/stack/l2cap/l2c_fcr.c
@@ -849,6 +849,14 @@ void l2c_lcc_proc_pdu(tL2C_CCB *p_ccb, BT_HDR *p_buf)
849849 return;
850850 }
851851
852+ if (sdu_length < p_buf->len) {
853+ L2CAP_TRACE_ERROR("%s: Invalid sdu_length: %d", __func__, sdu_length);
854+ android_errorWriteWithInfoLog(0x534e4554, "112321180", -1, NULL, 0);
855+ /* Discard the buffer */
856+ osi_free(p_buf);
857+ return;
858+ }
859+
852860
853861 if ((p_data = (BT_HDR *) osi_malloc(L2CAP_MAX_BUF_SIZE)) == NULL)
854862 {