The GlobalConfigurationBranch::createCustomReferralCode function lacks essential validation checks for the customReferralCode. Specifically, it does not verify that the customReferralCode is not empty, and it fails to check if the customReferralCode is already in use. This could allow for the creation of empty or duplicate referral codes, potentially leading to conflicts and unintended behavior in the referral system.
The function createCustomReferralCode is designed to create a custom referral code for a specified referrer. However, it does not perform necessary checks to ensure the integrity and uniqueness of the customReferralCode.
Here is a relevant code snippet
Lack of existing `customReferralCode` means referrers might lose their custom codes unexpectedly potentially leading to loss of referral relationships and rewards.
Manual Review
Implement checks for both empty strings and existing referral codes. Here's an improved version of the function:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.