Tadle

Tadle
DeFi
30,000 USDC
View results
Submission Details
Severity: low
Invalid

Missing return value in `DeliveryPlace::getOfferInfo`, function will return wrong(default) values for all parameters.

Summary

The DeliveryPlace::getOfferInfofunction expects return values, but no return statement is provided.

Vulnerability Details

function getOfferInfo(
address _offer
)
internal
view
returns (//@audit - supposed to return but no return statement placed
OfferInfo memory offerInfo,
MakerInfo memory makerInfo,
MarketPlaceInfo memory marketPlaceInfo,
MarketPlaceStatus status
){...}

As per the function definition we can understand that it is supposed to fetch the offer information. The following parameters are fetched and is to be returned when the function is called :

OfferInfo memory offerInfo,
MakerInfo memory makerInfo,
MarketPlaceInfo memory marketPlaceInfo,
MarketPlaceStatus status

The function fetches the parameters in the function body, but doesn't return the fetched values. As there is no return statement present.
link to code

Impact

In solidity when a function expects a return value and no return statement is provided, function will return default values for all parameters that is expected to be returned. And the offer info returned will be wrong everytime.

Tools Used

Manual review

Recommendations

Implement returnstatement to return the expected parameters.

Updates

Lead Judging Commences

0xnevi Lead Judge
11 months ago
0xnevi Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.