Submitted by minhquanym, also found by bin2chen and oakcobalt
MultiSourceLoan.sol#L1172-L1188
The refinanceFull() and addNewTranche() functions share the same signature. This could lead to an issue where a user signs a signature for a full refinance, but it gets used in addNewTranche(). This could inadvertently increase the principal amount of the loan, which may not be the users intention.
The fix did differentiating between the two functions by using the length of trancheIndex and the value of trancheIndex[0].
With this check in place, I believe the RenegotiationOffer for a loan with 1 tranche can still be used for both functions. This is because trancheIndex isnt actually used in refinanceFull, but only in refinancePartial. So the out-of-bound exception will not be raised in refinanceFull.
0xsomeone (judge) commented:
