diff options
author | 2023-05-01 20:41:00 +0200 | |
---|---|---|
committer | 2023-05-01 20:41:00 +0200 | |
commit | 28be9537a632625deaa7d71979ebf725b1b9bbc2 (patch) | |
tree | e9c8ea1d1f570aadf0ddec80d3a119c93ee7f753 | |
parent | 1480e2b681cc6cbf822f7d9e27640492f4f57a9b (diff) | |
download | libirecovery-28be9537a632625deaa7d71979ebf725b1b9bbc2.tar.gz libirecovery-28be9537a632625deaa7d71979ebf725b1b9bbc2.tar.bz2 |
Return error instead of truncating command buffer if command is too long
-rw-r--r-- | src/libirecovery.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libirecovery.c b/src/libirecovery.c index fc1e2cf..8ebc9fa 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c | |||
@@ -2601,7 +2601,7 @@ IRECV_API void irecv_set_debug_level(int level) { | |||
2601 | static irecv_error_t irecv_send_command_raw(irecv_client_t client, const char* command, uint8_t b_request) { | 2601 | static irecv_error_t irecv_send_command_raw(irecv_client_t client, const char* command, uint8_t b_request) { |
2602 | unsigned int length = strlen(command); | 2602 | unsigned int length = strlen(command); |
2603 | if (length >= 0x100) { | 2603 | if (length >= 0x100) { |
2604 | length = 0xFF; | 2604 | return IRECV_E_INVALID_INPUT; |
2605 | } | 2605 | } |
2606 | 2606 | ||
2607 | if (length > 0) { | 2607 | if (length > 0) { |
@@ -2623,7 +2623,7 @@ IRECV_API irecv_error_t irecv_send_command_breq(irecv_client_t client, const cha | |||
2623 | 2623 | ||
2624 | unsigned int length = strlen(command); | 2624 | unsigned int length = strlen(command); |
2625 | if (length >= 0x100) { | 2625 | if (length >= 0x100) { |
2626 | length = 0xFF; | 2626 | return IRECV_E_INVALID_INPUT; |
2627 | } | 2627 | } |
2628 | 2628 | ||
2629 | irecv_event_t event; | 2629 | irecv_event_t event; |