Fixup a patch thanks to @Skyblueborb

See https://review.lineageos.org/c/LineageOS/android_vendor_qcom_opensource_system_bt/+/385592/1..2

Signed-off-by: Tavi <tavi@divested.dev>
This commit is contained in:
Tavi 2024-04-08 09:35:21 -04:00
parent e5f019d63d
commit 113cbef36e
No known key found for this signature in database
GPG Key ID: E599F62ECBAEAF2E

View File

@ -33,7 +33,7 @@ index d1e0ece59..3117dc6ea 100644
+#define CHECK_SIZE() \ +#define CHECK_SIZE() \
+ do { \ + do { \
+ if (size_now > payload_size) { \ + if (size_now > payload_size) { \
+ LOG_ERROR("payload size too small"); \ + LOG(ERROR) << "payload size too small"; \
+ osi_free(p_buf); \ + osi_free(p_buf); \
+ return nullptr; \ + return nullptr; \
+ } \ + } \
@ -99,7 +99,7 @@ index d1e0ece59..3117dc6ea 100644
+ // backfill pair len field + // backfill pair len field
+ if (op_code == GATT_RSP_READ_BY_TYPE) { + if (op_code == GATT_RSP_READ_BY_TYPE) {
+ if (pair_len > UINT8_MAX) { + if (pair_len > UINT8_MAX) {
+ LOG_ERROR("pair_len greater than %d", UINT8_MAX); + LOG(ERROR) << StringPrintf("pair_len greater than %d", UINT8_MAX);
+ osi_free(p_buf); + osi_free(p_buf);
+ return nullptr; + return nullptr;
+ } + }