summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2023-05-01 20:41:00 +0200
committerGravatar Nikias Bassen2023-05-01 20:41:00 +0200
commit28be9537a632625deaa7d71979ebf725b1b9bbc2 (patch)
treee9c8ea1d1f570aadf0ddec80d3a119c93ee7f753
parent1480e2b681cc6cbf822f7d9e27640492f4f57a9b (diff)
downloadlibirecovery-28be9537a632625deaa7d71979ebf725b1b9bbc2.tar.gz
libirecovery-28be9537a632625deaa7d71979ebf725b1b9bbc2.tar.bz2
Return error instead of truncating command buffer if command is too long
-rw-r--r--src/libirecovery.c4
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) {
static irecv_error_t irecv_send_command_raw(irecv_client_t client, const char* command, uint8_t b_request) {
unsigned int length = strlen(command);
if (length >= 0x100) {
- length = 0xFF;
+ return IRECV_E_INVALID_INPUT;
}
if (length > 0) {
@@ -2623,7 +2623,7 @@ IRECV_API irecv_error_t irecv_send_command_breq(irecv_client_t client, const cha
unsigned int length = strlen(command);
if (length >= 0x100) {
- length = 0xFF;
+ return IRECV_E_INVALID_INPUT;
}
irecv_event_t event;