Skip to content

fix: NUL-terminate ADB OPEN destinations - #211

Merged
cocool97 merged 2 commits into
cocool97:mainfrom
atty303:fix/nul-terminate-open-destination
Aug 2, 2026
Merged

fix: NUL-terminate ADB OPEN destinations#211
cocool97 merged 2 commits into
cocool97:mainfrom
atty303:fix/nul-terminate-open-destination

Conversation

@atty303

@atty303 atty303 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Problem

On an Android 7 device, a direct USB push consistently failed while opening the sync: service:

ADB request failed - Open session failed: got CLSE in response instead of OKAY

The same push succeeded through an ADB server connection.

adb_client sent the OPEN destination without a trailing NUL. AOSP adb NUL-terminates this payload and notes that adbd expects a null-terminated string:

https://android.googlesource.com/platform/system/core/+/dc29476d7e029e6c477c133b71ca55d52ee95744/adb/sockets.cpp#480

Verification

  • Reproduced the direct USB push failure on an Android 7 device before this patch
  • Confirmed the same direct USB push succeeds on that device after this patch
  • cargo test -p adb_client

Note

The investigation and implementation were performed with OpenAI Codex.

@cocool97

cocool97 commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Thanks for the fix ! :)

@cocool97
cocool97 merged commit 547f346 into cocool97:main Aug 2, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants