From d559eb56ce5138863121d2879d0f010bb9280365 Mon Sep 17 00:00:00 2001 From: SiliconA-Z Date: Mon, 23 Mar 2026 08:49:56 -0400 Subject: [PATCH] Mark some changes of REVISION >= 0xA to be UBFix. (#738) Turns out emerald already has some of these changes, defined as UBFIX, so let's add them here too, and I will port the if ((llFrameSize_p && subFrameSize > *llFrameSize_p) || subFrameSize <= frameSize) while we are at it. --- src/librfu_rfu.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/librfu_rfu.c b/src/librfu_rfu.c index 909903eca..76e2158e6 100644 --- a/src/librfu_rfu.c +++ b/src/librfu_rfu.c @@ -784,7 +784,7 @@ static void rfu_CB_pollConnectParent(u8 reqCommand, u16 reqResult) u16 id; u8 slot; u8 bm_slot_flag, i; -#if REVISION >= 0xA +#if REVISION >= 0xA || defined(UBFIX) struct RfuTgtData *target_p = NULL; #else struct RfuTgtData *target_p; @@ -1424,7 +1424,7 @@ static u16 rfu_STC_setSendData_org(u8 ni_or_uni, u8 bmSendSlot, u8 subFrameSize, { u8 bm_slot_id, sendSlotFlag; u8 frameSize; -#if REVISION >= 0xA +#if REVISION >= 0xA || defined(UBFIX) u8 *llFrameSize_p = NULL; #else u8 *llFrameSize_p; @@ -1454,7 +1454,11 @@ static u16 rfu_STC_setSendData_org(u8 ni_or_uni, u8 bmSendSlot, u8 subFrameSize, else if (gRfuLinkStatus->parentChild == MODE_CHILD) llFrameSize_p = &gRfuLinkStatus->remainLLFrameSizeChild[bm_slot_id]; frameSize = llsf_struct[gRfuLinkStatus->parentChild].frameSize; +#ifdef UBFIX + if ((llFrameSize_p && subFrameSize > *llFrameSize_p) || subFrameSize <= frameSize) +#else if (subFrameSize > *llFrameSize_p || subFrameSize <= frameSize) +#endif return ERR_SUBFRAME_SIZE; imeBak = REG_IME; REG_IME = 0;