diff options
| author | 2024-09-25 00:34:10 +0200 | |
|---|---|---|
| committer | 2024-09-25 00:34:10 +0200 | |
| commit | 3039480107e77c08206fb42e202ec3d1ec3609c1 (patch) | |
| tree | 4e56bfd5aa21e6f6a03cb905f15e2971a867f1ce /src/libirecovery.c | |
| parent | 85f4ac0876b886c63446be27f1316bddb72d5195 (diff) | |
| download | libirecovery-3039480107e77c08206fb42e202ec3d1ec3609c1.tar.gz libirecovery-3039480107e77c08206fb42e202ec3d1ec3609c1.tar.bz2 | |
win32: Fix crash due to access to uninitialized data
Diffstat (limited to 'src/libirecovery.c')
| -rw-r--r-- | src/libirecovery.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libirecovery.c b/src/libirecovery.c index c7afe7b..efcb7b4 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c | |||
| @@ -2310,6 +2310,11 @@ static void* _irecv_handle_device_add(void *userdata) | |||
| 2310 | 2310 | ||
| 2311 | if (product_id == KIS_PRODUCT_ID) { | 2311 | if (product_id == KIS_PRODUCT_ID) { |
| 2312 | client = (irecv_client_t)malloc(sizeof(struct irecv_client_private)); | 2312 | client = (irecv_client_t)malloc(sizeof(struct irecv_client_private)); |
| 2313 | if (client == NULL) { | ||
| 2314 | debug("%s: Failed to allocate memory\n", __func__); | ||
| 2315 | return NULL; | ||
| 2316 | } | ||
| 2317 | memset(client, '\0', sizeof(struct irecv_client_private)); | ||
| 2313 | client->handle = CreateFileA(result, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); | 2318 | client->handle = CreateFileA(result, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); |
| 2314 | if (client->handle == INVALID_HANDLE_VALUE) { | 2319 | if (client->handle == INVALID_HANDLE_VALUE) { |
| 2315 | debug("%s: Failed to open device path %s\n", __func__, result); | 2320 | debug("%s: Failed to open device path %s\n", __func__, result); |
