Skip to content

Commit

Permalink
[Android] Fix CHIPTool cluster cmds fail or app crashes (Issue #15637)…
Browse files Browse the repository at this point in the history
…. (#15919)

* [Android] Fix CHIPTool cluster cmds fail or app crashes (Issue #15637).

* [Android] Fix expression in verification instead of commenting out the verification.

* Restyled by clang-format

* [Android] Fix merge issue and revert un-necessary changes to verification expression

Co-authored-by: Lisandre Taylor <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
3 people authored and pull[bot] committed Aug 29, 2023
1 parent 286017a commit 1533492
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/platform/android/DnssdImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jmethodID sPublishMethod = nullptr;
jmethodID sRemoveServicesMethod = nullptr;
} // namespace

// Implemention of functions declared in lib/dnssd/platform/Dnssd.h
// Implementation of functions declared in lib/dnssd/platform/Dnssd.h

CHIP_ERROR ChipDnssdInit(DnssdAsyncReturnCallback initCallback, DnssdAsyncReturnCallback errorCallback, void * context)
{
Expand Down
2 changes: 1 addition & 1 deletion src/platform/android/KeyValueStoreManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Get(const char * key, void * value, size_t
ChipLogError(DeviceLayer, "KeyValueStoreManager base64 decoding failed");
return CHIP_ERROR_INTEGRITY_CHECK_FAILED;
}
ReturnErrorCodeIf(offset_bytes >= decodedLength, CHIP_ERROR_INVALID_ARGUMENT);
ReturnErrorCodeIf(offset_bytes != 0 && offset_bytes >= decodedLength, CHIP_ERROR_INVALID_ARGUMENT);
size_t read_size = std::min<size_t>(value_size, decodedLength - offset_bytes);
if (value_size + offset_bytes < decodedLength)
{
Expand Down

0 comments on commit 1533492

Please sign in to comment.