diff options
| author | 2015-12-31 19:53:09 +0100 | |
|---|---|---|
| committer | 2015-12-31 19:53:09 +0100 | |
| commit | 166af423e44039a6f17d46d171cd90fcbee393aa (patch) | |
| tree | e8b21484a36dec631bd943f0f638f79e55a5035b /src/libirecovery.c | |
| parent | f04314a191afa506d6705d65bc7464a8c143fbc2 (diff) | |
| download | libirecovery-166af423e44039a6f17d46d171cd90fcbee393aa.tar.gz libirecovery-166af423e44039a6f17d46d171cd90fcbee393aa.tar.bz2 | |
Fix iokit_get_string_descriptor_ascii by returning the size of the string
Diffstat (limited to 'src/libirecovery.c')
| -rw-r--r-- | src/libirecovery.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libirecovery.c b/src/libirecovery.c index d80d8cc..9284316 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c | |||
| @@ -249,6 +249,7 @@ static int iokit_get_string_descriptor_ascii(irecv_client_t client, uint8_t desc | |||
| 249 | request.wIndex = 0; // All languages 0x409; // language | 249 | request.wIndex = 0; // All languages 0x409; // language |
| 250 | request.wLength = sizeof(descriptor) - 1; | 250 | request.wLength = sizeof(descriptor) - 1; |
| 251 | request.pData = descriptor; | 251 | request.pData = descriptor; |
| 252 | request.wLenDone = 0; | ||
| 252 | 253 | ||
| 253 | result = (*client->handle)->DeviceRequest(client->handle, &request); | 254 | result = (*client->handle)->DeviceRequest(client->handle, &request); |
| 254 | if (result == kIOReturnNoDevice) | 255 | if (result == kIOReturnNoDevice) |
| @@ -262,6 +263,7 @@ static int iokit_get_string_descriptor_ascii(irecv_client_t client, uint8_t desc | |||
| 262 | 263 | ||
| 263 | request.wValue = (kUSBStringDesc << 8) | desc_index; | 264 | request.wValue = (kUSBStringDesc << 8) | desc_index; |
| 264 | request.wIndex = descriptor[2] + (descriptor[3] << 8); | 265 | request.wIndex = descriptor[2] + (descriptor[3] << 8); |
| 266 | request.wLenDone = 0; | ||
| 265 | result = (*client->handle)->DeviceRequest(client->handle, &request); | 267 | result = (*client->handle)->DeviceRequest(client->handle, &request); |
| 266 | 268 | ||
| 267 | if (result == kIOReturnNoDevice) | 269 | if (result == kIOReturnNoDevice) |
| @@ -277,7 +279,7 @@ static int iokit_get_string_descriptor_ascii(irecv_client_t client, uint8_t desc | |||
| 277 | } | 279 | } |
| 278 | buffer[j] = 0; | 280 | buffer[j] = 0; |
| 279 | 281 | ||
| 280 | return IRECV_E_SUCCESS; | 282 | return request.wLenDone; |
| 281 | } | 283 | } |
| 282 | return IRECV_E_UNKNOWN_ERROR; | 284 | return IRECV_E_UNKNOWN_ERROR; |
| 283 | } | 285 | } |
