Secured the WPM and RPM service encoders (#604)

* Secured the WPM and RPM client service encoders.

* Fixed RPM and WPM apps when fail to encode request. 

* Fixed WPM app number of arguments checking.
This commit is contained in:
Steve Karg
2024-03-26 12:29:15 -05:00
committed by GitHub
parent 31ffc8024e
commit 80c51a06e3
7 changed files with 291 additions and 180 deletions
+4
View File
@@ -549,6 +549,10 @@ int main(int argc, char *argv[])
Request_Invoke_ID = Send_Read_Property_Multiple_Request(
&buffer[0], sizeof(buffer), Target_Device_Object_Instance,
Read_Access_Data);
if (Request_Invoke_ID == 0) {
fprintf(stderr, "\rError: failed to send request!\n");
break;
}
} else if (tsm_invoke_id_free(Request_Invoke_ID)) {
break;
} else if (tsm_invoke_id_failed(Request_Invoke_ID)) {
+5 -1
View File
@@ -307,7 +307,7 @@ int main(int argc, char *argv[])
return 0;
}
}
if (argc < 9) {
if (argc < 8) {
print_usage(filename);
return 0;
}
@@ -523,6 +523,10 @@ int main(int argc, char *argv[])
Request_Invoke_ID = Send_Write_Property_Multiple_Request(
&buffer[0], sizeof(buffer), Target_Device_Object_Instance,
Write_Access_Data);
if (Request_Invoke_ID == 0) {
fprintf(stderr, "\rError: failed to send request!\n");
break;
}
} else if (tsm_invoke_id_free(Request_Invoke_ID)) {
break;
} else if (tsm_invoke_id_failed(Request_Invoke_ID)) {