• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

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

system/bt


Commit MetaInfo

Révisiond3c7b86f225c877099bb4416c58fc494f0d00faa (tree)
l'heure2018-10-20 01:33:11
AuteurJakub Pawlowski <jpawlowski@goog...>
Commiterandroid-build-team Robot

Message de Log

Fix possible OOB read

Bug: 74249842
Change-Id: I0dbe43f0da1f5a8f14bcb69659752de4bd70ca98
(cherry picked from commit 6e6c347e798bf8195a9a02457edf871a97b1cfad)

Change Summary

Modification

--- a/stack/sdp/sdp_discovery.cc
+++ b/stack/sdp/sdp_discovery.cc
@@ -277,6 +277,11 @@ static void process_service_search_rsp(tCONN_CB* p_ccb, uint8_t* p_reply,
277277 uint16_t total, cur_handles, orig;
278278 uint8_t cont_len;
279279
280+ if (p_reply + 8 > p_reply_end) {
281+ android_errorWriteLog(0x534e4554, "74249842");
282+ sdp_disconnect(p_ccb, SDP_GENERIC_ERROR);
283+ return;
284+ }
280285 /* Skip transaction, and param len */
281286 p_reply += 4;
282287 BE_STREAM_TO_UINT16(total, p_reply);
@@ -295,6 +300,12 @@ static void process_service_search_rsp(tCONN_CB* p_ccb, uint8_t* p_reply,
295300 if (p_ccb->num_handles > sdp_cb.max_recs_per_search)
296301 p_ccb->num_handles = sdp_cb.max_recs_per_search;
297302
303+ if (p_reply + ((p_ccb->num_handles - orig) * 4) + 1 > p_reply_end) {
304+ android_errorWriteLog(0x534e4554, "74249842");
305+ sdp_disconnect(p_ccb, SDP_GENERIC_ERROR);
306+ return;
307+ }
308+
298309 for (xx = orig; xx < p_ccb->num_handles; xx++)
299310 BE_STREAM_TO_UINT32(p_ccb->handles[xx], p_reply);
300311