Android-x86
Fork
Spenden

  • R/O
  • HTTP
  • SSH
  • HTTPS

hardware-ril: Commit

hardware/ril


Commit MetaInfo

Revisionb78bffe25e4973b52c3afa01ff9a111bd36e3390 (tree)
Zeit2017-01-10 23:13:01
AutorChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

Android 6.0.1 release 74
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEABECAAYFAlgcztUACgkQ6K0/gZqxDngrVgCfcVAZr3/X2GkgTla9CT5T4TER
J2wAn0wOe+9dJLWBCFsUQOqrKOIHl1R+
=a+TS
-----END PGP SIGNATURE-----

Merge tag 'android-6.0.1_r74' into marshmallow-x86

Android 6.0.1 release 74

Ändern Zusammenfassung

Diff

--- a/libril/RilSapSocket.cpp
+++ b/libril/RilSapSocket.cpp
@@ -343,7 +343,12 @@ void RilSapSocket::sendResponse(MsgHeader* hdr) {
343343 if ((success = pb_get_encoded_size(&encoded_size, MsgHeader_fields,
344344 hdr)) && encoded_size <= INT32_MAX && commandFd != -1) {
345345 buffer_size = encoded_size + sizeof(uint32_t);
346- uint8_t buffer[buffer_size];
346+ uint8_t* buffer = (uint8_t*)malloc(buffer_size);
347+ if (!buffer) {
348+ RLOGE("sendResponse: OOM");
349+ pthread_mutex_unlock(&write_lock);
350+ return;
351+ }
347352 written_size = htonl((uint32_t) encoded_size);
348353 ostream = pb_ostream_from_buffer(buffer, buffer_size);
349354 pb_write(&ostream, (uint8_t *)&written_size, sizeof(written_size));
@@ -365,6 +370,7 @@ void RilSapSocket::sendResponse(MsgHeader* hdr) {
365370 RLOGE("Error while encoding response of type %d id %d buffer_size: %d: %s.",
366371 hdr->type, hdr->id, buffer_size, PB_GET_ERROR(&ostream));
367372 }
373+ free(buffer);
368374 } else {
369375 RLOGE("Not sending response type %d: encoded_size: %u. commandFd: %d. encoded size result: %d",
370376 hdr->type, encoded_size, commandFd, success);
@@ -436,7 +442,11 @@ void RilSapSocket::sendDisconnect() {
436442 if ((success = pb_get_encoded_size(&encoded_size, RIL_SIM_SAP_DISCONNECT_REQ_fields,
437443 &disconnectReq)) && encoded_size <= INT32_MAX) {
438444 buffer_size = encoded_size + sizeof(uint32_t);
439- uint8_t buffer[buffer_size];
445+ uint8_t* buffer = (uint8_t*)malloc(buffer_size);
446+ if (!buffer) {
447+ RLOGE("sendDisconnect: OOM");
448+ return;
449+ }
440450 written_size = htonl((uint32_t) encoded_size);
441451 ostream = pb_ostream_from_buffer(buffer, buffer_size);
442452 pb_write(&ostream, (uint8_t *)&written_size, sizeof(written_size));
@@ -468,6 +478,7 @@ void RilSapSocket::sendDisconnect() {
468478 else {
469479 RLOGE("Encode failed in send disconnect!");
470480 }
481+ free(buffer);
471482 }
472483 }
473484
Show on old repository browser