Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inquiry data truncated #152

Open
nielsmh opened this issue Jun 5, 2024 · 0 comments
Open

Inquiry data truncated #152

nielsmh opened this issue Jun 5, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@nielsmh
Copy link
Contributor

nielsmh commented Jun 5, 2024

Responses to standard (non-EVPD) Inquiry commands are truncated at 31 "additional data" bytes, meaning that the vendor-specific information (such as firmware revision) gets truncated, though the truncation might be happening in the ASPI driver on PC.

0x1f, // standard length.

The additional data size field (index 4) should probably be updated somewhere before s2s_getStandardInquiry returns:

if(cfg->deviceType != S2S_CFG_NETWORK && cfg->deviceType != S2S_CFG_ZIP100) {
memcpy(&out[size], PLATFORM_INQUIRY, sizeof(PLATFORM_INQUIRY));
size += sizeof(PLATFORM_INQUIRY);
out[size] = PLATFORM_TOOLBOX_API;
size += 1;
}
return size;

Additionally, the data in the PLATFORM_INQUIRY constant (that I currently can't read with software) seems to be 24 bytes long, but the Vendor-Specific field at offset 36 it gets written to is only specified to be 20 bytes long, meaning this code writes into reserved space as well.

@erichelgeson erichelgeson self-assigned this Jun 6, 2024
@erichelgeson erichelgeson added the bug Something isn't working label Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants